### Question:
AvroType implements PType<T> { public T getDetachedValue(T value) { if (this.baseInputMapFn instanceof IdentityFn && !Avros.isPrimitive(this)) { return getDeepCopier().deepCopy(value); } return value; } AvroType(Class<T> typeClass, Schema schema, PType... ptypes);  AvroType(Class<T> typeClass, Schema schema, MapFn inputMapFn,
			MapFn outputMapFn, PType... ptypes); @Override Class<T> getTypeClass(); @Override PTypeFamily getFamily(); @Override List<PType> getSubTypes(); Schema getSchema(); boolean isSpecific(); boolean isGeneric(); MapFn<Object, T> getInputMapFn(); MapFn<T, Object> getOutputMapFn(); @Override Converter getConverter(); @Override SourceTarget<T> getDefaultFileSource(Path path); T getDetachedValue(T value); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void testGetDetachedValue_AlreadyMappedAvroType() { Integer value = 42; Integer detachedValue = Avros.ints().getDetachedValue(value); assertSame(value, detachedValue); }
@Test public void testGetDetachedValue_GenericAvroType() { AvroType<Record> genericType = Avros.generics(Person.SCHEMA$); GenericData.Record record = new GenericData.Record(Person.SCHEMA$); record.put("name", "name value"); record.put("age", 42); record.put("siblingnames", Lists.newArrayList()); Record detachedRecord = genericType.getDetachedValue(record); assertEquals(record, detachedRecord); assertNotSame(record, detachedRecord); }
@Test public void testGetDetachedValue_SpecificAvroType() { AvroType<Person> specificType = Avros.records(Person.class); Person person = new Person(); person.setName("name value"); person.setAge(42); person.setSiblingnames(Lists.<CharSequence> newArrayList()); Person detachedPerson = specificType.getDetachedValue(person); assertEquals(person, detachedPerson); assertNotSame(person, detachedPerson); }
@Test public void testGetDetachedValue_ReflectAvroType() { AvroType<Person> reflectType = Avros.reflects(Person.class); Person person = new Person(); person.setName("name value"); person.setAge(42); person.setSiblingnames(Lists.<CharSequence> newArrayList()); Person detachedPerson = reflectType.getDetachedValue(person); assertEquals(person, detachedPerson); assertNotSame(person, detachedPerson); }