### Question:
IdentitySerializerFactory { public static Serializer getSerializer(TypeMirror typeMirror) { return new IdentitySerializer(typeMirror); } private  IdentitySerializerFactory(); static Serializer getSerializer(TypeMirror typeMirror);  }### Answer:
@Test public void proxyFieldType_isUnchanged() throws Exception { TypeMirror typeMirror = typeMirrorOf(String.class); TypeMirror actualTypeMirror = IdentitySerializerFactory.getSerializer(typeMirror).proxyFieldType(); assertThat(actualTypeMirror).isSameInstanceAs(typeMirror); }
@Test public void toProxy_isUnchanged() throws Exception { TypeMirror typeMirror = typeMirrorOf(String.class); CodeBlock inputExpression = CodeBlock.of("x"); CodeBlock outputExpression = IdentitySerializerFactory.getSerializer(typeMirror).toProxy(inputExpression); assertThat(outputExpression).isSameInstanceAs(inputExpression); }
@Test public void fromProxy_isUnchanged() throws Exception { TypeMirror typeMirror = typeMirrorOf(String.class); CodeBlock inputExpression = CodeBlock.of("x"); CodeBlock outputExpression = IdentitySerializerFactory.getSerializer(typeMirror).fromProxy(inputExpression); assertThat(outputExpression).isSameInstanceAs(inputExpression); }
@Test public void isIdentity() throws Exception { TypeMirror typeMirror = typeMirrorOf(String.class); boolean actualIsIdentity = IdentitySerializerFactory.getSerializer(typeMirror).isIdentity(); assertThat(actualIsIdentity).isTrue(); }