AttributeKey extends AbstractConstant<AttributeKey<T>> { @SuppressWarnings("unchecked") public static <T> AttributeKey<T> valueOf(String name) { return (AttributeKey<T>) pool.valueOf(name); } private  AttributeKey(int id, String name); @SuppressWarnings("unchecked") static AttributeKey<T> valueOf(String name); static boolean exists(String name); @SuppressWarnings("unchecked") static AttributeKey<T> newInstance(String name); @SuppressWarnings("unchecked") static AttributeKey<T> valueOf(Class<?> firstNameComponent, String secondNameComponent);  }
@Test public void testValueOf() { String name = "test1"; assertFalse(AttributeKey.exists(name)); AttributeKey<String> attr = AttributeKey.valueOf(name); AttributeKey<String> attr2 = AttributeKey.valueOf(name); assertSame(attr, attr2); }