### Question:
AttributeBuilder implements Iterable<ByteString> { public Attribute toAttribute() throws IllegalStateException { if (attributeType == null) { throw new IllegalStateException("Undefined attribute type or name"); } Attribute attribute = toAttribute0(); attributeType = null; name = null; normalizedOptions = null; options.clear(); values = new SmallSet<>(); return attribute; } AttributeBuilder();  AttributeBuilder(Attribute attribute);  AttributeBuilder(Attribute attribute, boolean omitValues);  AttributeBuilder(AttributeType attributeType);  AttributeBuilder(AttributeType attributeType, String name);  AttributeBuilder(String attributeName); boolean add(String valueString); boolean add(ByteString attributeValue); boolean addAll(Attribute attribute); boolean addAll(Collection<ByteString> values); boolean addAllStrings(Collection<? extends Object> values); void clear(); boolean contains(ByteString value); boolean containsAll(Collection<ByteString> values); AttributeType getAttributeType(); boolean isEmpty(); @Override Iterator<ByteString> iterator(); boolean remove(ByteString value); boolean remove(String valueString); boolean removeAll(Attribute attribute); boolean removeAll(Collection<ByteString> values); void replace(ByteString value); void replace(String valueString); void replaceAll(Attribute attribute); void replaceAll(Collection<ByteString> values); void setAttributeType(AttributeType attributeType); void setAttributeType(
      AttributeType attributeType,
      String name); void setAttributeType(String attributeName); boolean setOption(String option); boolean setOptions(Collection<String> options); boolean optionsEqual(Set<String> options); int size(); Attribute toAttribute(); List<Attribute> toAttributeList(); @Override final String toString();  }### Answer:
@Test(expectedExceptions = IllegalStateException.class) public void testAttributeBuilderIllegalStateException1() throws Exception { AttributeBuilder builder = new AttributeBuilder(); builder.toAttribute(); }
@Test(expectedExceptions = IllegalStateException.class) public void testAttributeBuilderIllegalStateException2() throws Exception { AttributeBuilder builder = new AttributeBuilder(cnType); try { builder.toAttribute(); } catch (IllegalStateException e) { Assert.fail("Got unexpected IllegalStateException"); } builder.toAttribute(); }