### Question:
SplitByEveryRadioButton extends RadioButton implements SplitParametersBuilderCreator, RestorableView, ResettableView { @Override public void saveStateTo(Map<String, String> data) { if (isSelected()) { data.put("splitByEvery", Boolean.TRUE.toString()); } data.put("splitByEvery.field", defaultString(field.getText())); } SplitByEveryRadioButton(ValidableTextField field); @Override SplitByEveryXPagesParametersBuilder getBuilder(Consumer<String> onError); @Override void saveStateTo(Map<String, String> data); @Override void restoreStateFrom(Map<String, String> data); @Override void resetView();  }### Answer:
@Test public void saveStateSelected() { clickOn(victim); clickOn("#field").write("chuck"); Map<String, String> data = new HashMap<>(); victim.saveStateTo(data); assertTrue(Boolean.valueOf(data.get("splitByEvery"))); assertEquals("chuck", data.get("splitByEvery.field")); }
@Test public void saveStateNotSelected() { Map<String, String> data = new HashMap<>(); victim.saveStateTo(data); assertFalse(Boolean.valueOf(data.get("splitByEvery"))); assertEquals("", data.get("splitByEvery.field")); }