### Question:
SplitAfterPredefinedSetOfPagesRadioButton extends RadioButton implements SplitParametersBuilderCreator, RestorableView, ResettableView { @Override public void saveStateTo(Map<String, String> data) { if (isSelected()) { data.put("splitAfterPredefined", Boolean.TRUE.toString()); } KeyStringValueItem<PredefinedSetOfPages> selected = combo.getSelectionModel().getSelectedItem(); if (selected != null) { data.put("splitAfterPredefined.combo", defaultString(selected.getKey().toString())); } } SplitAfterPredefinedSetOfPagesRadioButton(ComboBox<KeyStringValueItem<PredefinedSetOfPages>> combo); @Override void resetView(); @Override SimpleSplitParametersBuilder getBuilder(Consumer<String> onError); @Override void saveStateTo(Map<String, String> data); @Override void restoreStateFrom(Map<String, String> data);  }### Answer:
@Test @Category(NoHeadless.class) public void saveStateSelected() { clickOn(victim); clickOn("#combo").clickOn("Odd pages"); Map<String, String> data = new HashMap<>(); WaitForAsyncUtils.waitForAsyncFx(2000, () -> { victim.saveStateTo(data); assertTrue(Boolean.valueOf(data.get("splitAfterPredefined"))); assertEquals(PredefinedSetOfPages.ODD_PAGES.toString(), data.get("splitAfterPredefined.combo")); }); }
@Test public void saveStateNotSelected() { Map<String, String> data = new HashMap<>(); WaitForAsyncUtils.waitForAsyncFx(2000, () -> { victim.saveStateTo(data); assertFalse(Boolean.valueOf(data.get("splitAfterPredefined"))); assertEquals(PredefinedSetOfPages.ALL_PAGES.toString(), data.get("splitAfterPredefined.combo")); }); }