### Question:
FilterViewModel { public EntryFilter getExerciseFilter() { final EntryFilter entryFilter = new EntryFilter(); entryFilter.setDateStart(dateStart.get()); entryFilter.setDateEnd(dateEnd.get()); entryFilter.setEntryType(entryType.get()); entryFilter.setSportType(sportType.get()); entryFilter.setSportSubType(sportSubtype.get()); entryFilter.setIntensity(intensity.get().intensityType); entryFilter.setEquipment(equipment.get()); entryFilter.setCommentSubString(StringUtils.getTrimmedTextOrNull(commentSubString.get())); entryFilter.setRegularExpressionMode(regularExpressionMode.get()); return entryFilter; } FilterViewModel(final EntryFilter entryFilter, final boolean entryTypeSelectable); EntryFilter getExerciseFilter(); final ObjectProperty<LocalDate> dateStart; final ObjectProperty<LocalDate> dateEnd; final ObjectProperty<EntryFilter.EntryType> entryType; final ObjectProperty<SportType> sportType; final ObjectProperty<SportSubType> sportSubtype; final ObjectProperty<IntensityItem> intensity; final ObjectProperty<Equipment> equipment; final StringProperty commentSubString; final BooleanProperty regularExpressionMode; final BooleanProperty entryTypeSelectable; }### Answer:
@Test public void testGetExerciseFilter() { FilterViewModel viewModel = new FilterViewModel(entryFilter, true); EntryFilter unmodifiedFilter = viewModel.getExerciseFilter(); assertEquals(entryFilter.getDateStart(), unmodifiedFilter.getDateStart()); assertEquals(entryFilter.getDateEnd(), unmodifiedFilter.getDateEnd()); assertEquals(entryFilter.getEntryType(), unmodifiedFilter.getEntryType()); assertEquals(entryFilter.getSportType(), unmodifiedFilter.getSportType()); assertEquals(entryFilter.getSportSubType(), unmodifiedFilter.getSportSubType()); assertEquals(entryFilter.getIntensity(), unmodifiedFilter.getIntensity()); assertEquals(entryFilter.getEquipment(), unmodifiedFilter.getEquipment()); assertEquals(entryFilter.getCommentSubString(), unmodifiedFilter.getCommentSubString()); assertEquals(entryFilter.isRegularExpressionMode(), unmodifiedFilter.isRegularExpressionMode()); viewModel.dateEnd.set(LocalDate.of(2014, 12, 31)); viewModel.entryType.set(EntryFilter.EntryType.WEIGHT); viewModel.sportSubtype.set(new SportSubType(201)); viewModel.intensity.set(new FilterViewModel.IntensityItem(null)); viewModel.commentSubString.set(" Bar Foo "); EntryFilter modifiedFilter = viewModel.getExerciseFilter(); assertEquals(LocalDate.of(2014, 12, 31), modifiedFilter.getDateEnd()); assertEquals(EntryFilter.EntryType.WEIGHT, modifiedFilter.getEntryType()); assertEquals(201, modifiedFilter.getSportSubType().getId()); assertNull(modifiedFilter.getIntensity()); assertEquals("Bar Foo", modifiedFilter.getCommentSubString()); }