OptionsImpl extends AbstractFieldImpl implements Options { @Override public List<OptionItem> getItems() { if (optionItems == null) { populateOptionItems(); } return Collections.unmodifiableList(optionItems); }  @Override List<OptionItem> getItems(); @Override String getHelpMessage(); @Override Type getType(); @Override String getValue();  }
@Test public void testDatasourceAsOptionsSource() { Options options = getOptionsUnderTest(OPTIONS_3); List<OptionItem> optionItems = options.getItems(); assertNotNull(optionItems); assertEquals(optionItems.size(), 2); evaluateOptionItem(optionItems.get(0), "datasource-item1-name", "datasource-item1-value", true, false); evaluateOptionItem(optionItems.get(1), "datasource-item2-name", "datasource-item2-value", false, true); Utils.testJSONExport(options, Utils.getTestExporterJSONPath(TEST_BASE, OPTIONS_3)); }
@Test public void testListAsOptionsSource() { Options options = getOptionsUnderTest(OPTIONS_4); List<OptionItem> optionItems = options.getItems(); assertNotNull(optionItems); assertEquals(optionItems.size(), 2); evaluateOptionItem(optionItems.get(0), "list-item1-name", "list-item1-value", true, false); evaluateOptionItem(optionItems.get(1), "list-item2-name", "list-item2-value", false, true); Utils.testJSONExport(options, Utils.getTestExporterJSONPath(TEST_BASE, OPTIONS_4)); }