@Test public void getOptions_not_include_options_with_bad_size() throws Exception { when(store.read(eq(ConfigManager.ORDER))).thenReturn(Arrays.asList("n1", "n2")); when(store.read(eq(ConfigManager.KEY_PREFIX + "n1"))).thenReturn(Collections.singletonList("v1")); when(store.read(eq(ConfigManager.KEY_PREFIX + "n1"))).thenReturn(Arrays.asList("v1", "v2", "v3")); assertEquals(simpleOptions("opt1", "opt2"), configManager.getOptions()); }
List<FillOption> getOptions() { final List<FillOption> savedOptions = readConfigsFromStore(); final List<FillOption> result = new ArrayList<>(fillConfig.getOptions().size() + savedOptions.size()); result.addAll(savedOptions); result.addAll(fillConfig.getOptions()); return result; }
ConfigManager { List<FillOption> getOptions() { final List<FillOption> savedOptions = readConfigsFromStore(); final List<FillOption> result = new ArrayList<>(fillConfig.getOptions().size() + savedOptions.size()); result.addAll(savedOptions); result.addAll(fillConfig.getOptions()); return result; } }
ConfigManager { List<FillOption> getOptions() { final List<FillOption> savedOptions = readConfigsFromStore(); final List<FillOption> result = new ArrayList<>(fillConfig.getOptions().size() + savedOptions.size()); result.addAll(savedOptions); result.addAll(fillConfig.getOptions()); return result; } ConfigManager(FillConfig fillConfig, Store store); }
ConfigManager { List<FillOption> getOptions() { final List<FillOption> savedOptions = readConfigsFromStore(); final List<FillOption> result = new ArrayList<>(fillConfig.getOptions().size() + savedOptions.size()); result.addAll(savedOptions); result.addAll(fillConfig.getOptions()); return result; } ConfigManager(FillConfig fillConfig, Store store);  }
ConfigManager { List<FillOption> getOptions() { final List<FillOption> savedOptions = readConfigsFromStore(); final List<FillOption> result = new ArrayList<>(fillConfig.getOptions().size() + savedOptions.size()); result.addAll(savedOptions); result.addAll(fillConfig.getOptions()); return result; } ConfigManager(FillConfig fillConfig, Store store);   }