### Question:
RotateOptionsPane extends HBox implements TaskParametersBuildStep<RotateParametersBuilder>, RestorableView, ResettableView { @Override public void restoreStateFrom(Map<String, String> data) { Optional.ofNullable(data.get("rotation")).map(Rotation::valueOf).map(r -> keyEmptyValue(r)) .ifPresent(r -> this.rotation.getSelectionModel().select(r)); Optional.ofNullable(data.get("rotationType")).map(PredefinedSetOfPages::valueOf).map(r -> keyEmptyValue(r)) .ifPresent(r -> this.rotationType.getSelectionModel().select(r)); } RotateOptionsPane(); @Override void resetView(); @Override void apply(RotateParametersBuilder builder, Consumer<String> onError); @Override void saveStateTo(Map<String, String> data); @Override void restoreStateFrom(Map<String, String> data);  }### Answer:
@Test public void restoreStateFrom() { ComboBox<KeyStringValueItem<PredefinedSetOfPages>> rotationType = lookup("#rotationType").queryComboBox(); ComboBox<KeyStringValueItem<Rotation>> rotation = lookup("#rotation").queryComboBox(); Map<String, String> data = new HashMap<>(); data.put("rotation", Rotation.DEGREES_270.toString()); data.put("rotationType", PredefinedSetOfPages.EVEN_PAGES.toString()); WaitForAsyncUtils.waitForAsyncFx(2000, () -> victim.restoreStateFrom(data)); assertEquals(Rotation.DEGREES_270, rotation.getSelectionModel().getSelectedItem().getKey()); assertEquals(PredefinedSetOfPages.EVEN_PAGES, rotationType.getSelectionModel().getSelectedItem().getKey()); }