final Long noteId = command.entityId();
final NoteType type = NoteType.GROUP;
final Group group = this.groupRepository.findOne(resourceId);
if (group == null) { throw new GroupNotFoundException(resourceId); }
final Note noteForUpdate = this.noteRepository.findByGroupIdAndId(resourceId, noteId);
if (noteForUpdate == null) { throw new NoteNotFoundException(noteId, resourceId, type.name().toLowerCase()); }
final Map<String, Object> changes = noteForUpdate.update(command);