### Question:
AttributeIndexBuilder { public void visit(final AttributeDescr descr) { visit(descr.getName(), descr.getValue()); } AttributeIndexBuilder(final DefaultIndexBuilder builder); void visit(final AttributeDescr descr); void visit(final String name,
                      final String value); boolean isIgnored(final String attr);  }### Answer:
@Test(expected = IllegalStateException.class) public void unSupportedAttribute() { new AttributeIndexBuilder(builder).visit(new AttributeDescr("name", "value")); }
@Test() public void testIgnored() { final AttributeIndexBuilder attributeIndexBuilder = new AttributeIndexBuilder(builder); attributeIndexBuilder.visit(new AttributeDescr("no-loop", "value")); attributeIndexBuilder.visit(new AttributeDescr("lock-on-active", "value")); attributeIndexBuilder.visit(new AttributeDescr("salience", "value")); attributeIndexBuilder.visit(new AttributeDescr("auto-focus", "value")); attributeIndexBuilder.visit(new AttributeDescr("dialect", "value")); attributeIndexBuilder.visit(new AttributeDescr("date-effective", "value")); attributeIndexBuilder.visit(new AttributeDescr("date-expires", "value")); attributeIndexBuilder.visit(new AttributeDescr("enabled", "value")); attributeIndexBuilder.visit(new AttributeDescr("duration", "value")); attributeIndexBuilder.visit(new AttributeDescr("timer", "value")); attributeIndexBuilder.visit(new AttributeDescr("calendars", "value")); verify(builder, never()).addGenerator(any()); }
@Test() public void testValidValue() { new AttributeIndexBuilder(builder).visit(new AttributeDescr("activation-group", "value")); verify(builder).addGenerator(captor.capture()); final SharedPart value = captor.getValue(); List<KProperty<?>> kProperties = value.toIndexElements(); assertEquals(1, kProperties.size()); assertEquals("shared:activationgroup", kProperties.get(0).getName()); assertEquals("value", kProperties.get(0).getValue()); }