@Override public Alarm updateBookkeepingFields(AlarmId id, boolean isAcknowledged, String assignedUser) { Alarm found = store.getAlarm(id); if (found == null) { throw new ItemNotFoundException("Alarm with id " + id + " found"); } Alarm updated = new DefaultAlarm.Builder(found) .withId(found.id()) .withAcknowledged(isAcknowledged) .withAssignedUser(assignedUser).build(); store.setAlarm(updated); return updated; }