### Question:
NoteViewModel { public Note getNote() { final Note note = new Note(id); note.setDateTime(LocalDateTime.of(date.get(), time.get())); note.setComment(comment.getValue().trim()); return note; } NoteViewModel(final Note note); Note getNote(); final ObjectProperty<LocalDate> date; final ObjectProperty<LocalTime> time; final StringProperty comment; }### Answer:
@Test public void testGetNote() { NoteViewModel viewModel = new NoteViewModel(note); Note unmodifiedNote = viewModel.getNote(); assertEquals(note.getId(), unmodifiedNote.getId()); assertEquals(note.getDateTime(), unmodifiedNote.getDateTime()); assertEquals(note.getComment(), unmodifiedNote.getComment()); viewModel.time.set(LocalTime.of(14, 45)); viewModel.comment.set(" Bar Foo "); Note modifiedNote = viewModel.getNote(); assertEquals(LocalDateTime.of(2014, 10, 20, 14, 45, 0), modifiedNote.getDateTime()); assertEquals("Bar Foo", modifiedNote.getComment()); }