OptionGroupModelImpl implements OptionGroupModel { public Map<String, String> getAttributes() { return attributes; } OptionGroupModelImpl(String label, boolean disabled, List<OptionModel> options,
                                String... attributeKeysAndValues);  OptionGroupModelImpl(String label, boolean disabled, List<OptionModel> options,
                                Map<String, String> attributes); Map<String, String> getAttributes(); String getLabel(); List<OptionModel> getOptions(); boolean isDisabled(); @Override String toString();  }
@Test public void map_contructor_retains_map() { List<OptionModel> options = Collections.emptyList(); Map<String, String> attributes = Collections.emptyMap(); OptionGroupModel group = new OptionGroupModelImpl("Label", true, options, attributes); assertSame(group.getAttributes(), attributes); }
@Test public void strings_contructor_builds_map() { List<OptionModel> options = Collections.emptyList(); OptionGroupModel group = new OptionGroupModelImpl("Label", true, options, "fred", "flintstone", "barney", "rubble"); Map<String, String> attributes = group.getAttributes(); assertEquals(attributes.size(), 2); assertEquals(attributes.get("fred"), "flintstone"); assertEquals(attributes.get("barney"), "rubble"); }