### Question:
MoreTypes implements Types { public TypeMirror getTypeMirror(Class<?> clazz) { assertNotNull(clazz); if (clazz == void.class) { return typeUtils.getNoType(TypeKind.VOID); } if (clazz == boolean.class) { return typeUtils.getPrimitiveType(TypeKind.BOOLEAN); } if (clazz == char.class) { return typeUtils.getPrimitiveType(TypeKind.CHAR); } if (clazz == byte.class) { return typeUtils.getPrimitiveType(TypeKind.BYTE); } if (clazz == short.class) { return typeUtils.getPrimitiveType(TypeKind.SHORT); } if (clazz == int.class) { return typeUtils.getPrimitiveType(TypeKind.INT); } if (clazz == long.class) { return typeUtils.getPrimitiveType(TypeKind.LONG); } if (clazz == float.class) { return typeUtils.getPrimitiveType(TypeKind.FLOAT); } if (clazz == double.class) { return typeUtils.getPrimitiveType(TypeKind.DOUBLE); } if (clazz.isArray()) { TypeMirror componentType = getTypeMirror(clazz.getComponentType()); return typeUtils.getArrayType(componentType); } TypeElement typeElement = ctx.getMoreElements().getTypeElement(clazz); if (typeElement == null) { throw new AptIllegalStateException(clazz.getName()); } return typeElement.asType(); } MoreTypes(Context ctx, ProcessingEnvironment env); @Override Element asElement(TypeMirror t); @Override boolean isSubtype(TypeMirror t1, TypeMirror t2); @Override boolean contains(TypeMirror t1, TypeMirror t2); @Override boolean isSubsignature(ExecutableType m1, ExecutableType m2); @Override List<? extends TypeMirror> directSupertypes(TypeMirror t); @Override TypeMirror erasure(TypeMirror t); @Override TypeElement boxedClass(PrimitiveType p); @Override PrimitiveType unboxedType(TypeMirror t); @Override TypeMirror capture(TypeMirror t); @Override PrimitiveType getPrimitiveType(TypeKind kind); @Override NullType getNullType(); @Override NoType getNoType(TypeKind kind); @Override ArrayType getArrayType(TypeMirror componentType); @Override WildcardType getWildcardType(TypeMirror extendsBound, TypeMirror superBound); @Override DeclaredType getDeclaredType(TypeElement typeElem, TypeMirror... typeArgs); @Override DeclaredType getDeclaredType(
      DeclaredType containing, TypeElement typeElem, TypeMirror... typeArgs); @Override TypeMirror asMemberOf(DeclaredType containing, Element element); @Override boolean isAssignable(TypeMirror t1, TypeMirror t2); @Override boolean isSameType(TypeMirror t1, TypeMirror t2); TypeElement toTypeElement(TypeMirror typeMirror); DeclaredType toDeclaredType(TypeMirror typeMirror); TypeVariable toTypeVariable(TypeMirror typeMirror); ArrayType toArrayType(TypeMirror typeMirror); boolean isAssignableWithErasure(TypeMirror lhs, Class<?> rhs); boolean isAssignableWithErasure(TypeMirror lhs, TypeMirror rhs); boolean isSameTypeWithErasure(TypeMirror typeMirror, Class<?> clazz); boolean isSameTypeWithErasure(TypeMirror t1, TypeMirror t2); boolean isArray(TypeMirror typeMirror); String getTypeName(TypeMirror typeMirror); TypeMirror boxIfPrimitive(TypeMirror typeMirror); TypeMirror getTypeMirror(Class<?> clazz);  }### Answer:
@Test void getTypeMirror() { addProcessor( new TestProcessor() { @Override protected void run() { TypeMirror type = ctx.getMoreTypes().getTypeMirror(int.class); assertNotNull(type); assertEquals("int", type.toString()); } }, new TestProcessor() { @Override protected void run() { TypeMirror type = ctx.getMoreTypes().getTypeMirror(String.class); assertNotNull(type); assertEquals("java.lang.String", type.toString()); } }, new TestProcessor() { @Override protected void run() { TypeMirror type = ctx.getMoreTypes().getTypeMirror(String[].class); assertNotNull(type); assertEquals("java.lang.String[]", type.toString()); } }); }