Original code:
import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.UUID; class AlertService { private final MapAlertDAO storage = new MapAlertDAO(); public UUID raiseAlert() { return this.storage.addAlert(new Date()); } public Date getAlertTime(UUID id) { return this.storage.getAlert(id); } } class MapAlertDAO { private final Map
alerts = new HashMap
(); public UUID addAlert(Date time) { UUID id = UUID.randomUUID(); this.alerts.put(id, time); return id; } public Date getAlert(UUID id) { return this.alerts.get(id); } }
Dashboard
Start Trial
Sign In
Home
Tour
Tests
Questions
Pricing
Resources
Blog
Read Evidence-Based Hiring
Support
Sitemap
For Jobseekers
© TestDome, 2021.