### Question:
AttributeSet extends AbstractSet<TypedName<?>> implements Serializable { public Set<String> nameSet() { Set<String> s = nameSet; if (s == null) { nameSet = s = new NameSet(); } return s; } AttributeSet(TypedName<?>[] ans); static AttributeSet create(TypedName<?>... names); static AttributeSet create(List<? extends TypedName<?>> names); int lookup(TypedName<?> name); int lookup(TypedName<?> name, boolean matchSubclasses); int lookup(String name); TypedName<?> getAttribute(int idx); @Override Iterator<TypedName<?>> iterator(); @Override boolean contains(Object o); @Override int size(); Set<String> nameSet();  }### Answer:
@Test public void testNameSet() { AttributeSet attrs = AttributeSet.create(CommonAttributes.ENTITY_ID); assertThat(attrs.nameSet(), contains("id")); assertThat(attrs.nameSet().contains("id"), equalTo(true)); assertThat(attrs.nameSet().contains("foo"), equalTo(false)); }