### Question:
TypedName implements Serializable { @SuppressWarnings("unchecked") @Nonnull public static <T> TypedName<T> create(String name, Class<T> type) { Preconditions.checkNotNull(name, "name"); Preconditions.checkNotNull(type, "type"); if (type.isPrimitive()) { type = (Class<T>) ClassUtils.primitiveToWrapper(type); } TypedName<T> attribute = new TypedName<>(name.intern(), TypeToken.of(type)); return (TypedName<T>) FIELD_CACHE.intern(NAME_EQUIVALENCE.wrap(attribute)).get(); } private  TypedName(String n, TypeToken<T> t); @Nonnull String getName(); @Nonnull TypeToken<T> getType(); @Nonnull Class<? super T> getRawType(); JavaType getJacksonType(); T parseString(String value); @Override String toString(); @SuppressWarnings("unchecked") @Nonnull static TypedName<T> create(String name, Class<T> type); @SuppressWarnings("unchecked") @Nonnull static TypedName<T> create(String name, TypeToken<T> type); static TypedName<?> create(String name, String typeName);  }### Answer:
@Test public void testSerialize() { TypedName<String> attribute = TypedName.create("foo", String.class); assertThat(SerializationUtils.clone(attribute), sameInstance(attribute)); }
@Test public void testDifferentTypes() { TypedName<String> string = TypedName.create("foo", String.class); TypedName<File> file = TypedName.create("foo", File.class); assertThat(string, not(equalTo((TypedName) file))); }
@Test public void testTypeNames() { assertThat(TypedName.create("foo", "string"), equalTo(TypedName.create("foo", (Class) String.class))); assertThat(TypedName.create("bar", "long"), equalTo(TypedName.create("bar", (Class) Long.class))); assertThat(TypedName.create("bar", "int"), equalTo(TypedName.create("bar", (Class) Integer.class))); assertThat(TypedName.create("bar", "double"), equalTo(TypedName.create("bar", (Class) Double.class))); assertThat(TypedName.create("bar", "real"), equalTo(TypedName.create("bar", (Class) Double.class))); assertThat(TypedName.create("bar", "Double"), equalTo(TypedName.create("bar", (Class) Double.class))); assertThat(TypedName.create("bar", "Integer"), equalTo(TypedName.create("bar", (Class) Integer.class))); assertThat(TypedName.create("bar", "String"), equalTo(TypedName.create("bar", (Class) String.class))); assertThat(TypedName.create("file", "java.io.File"), equalTo(TypedName.create("file", (Class) File.class))); }