### Question:
MoreTypes implements Types { public TypeMirror boxIfPrimitive(TypeMirror typeMirror) { assertNotNull(typeMirror); return typeMirror.accept( new TypeKindVisitor8<TypeMirror, Void>() { public TypeMirror visitPrimitive(PrimitiveType t, Void p) { return typeUtils.boxedClass(t).asType(); } protected TypeMirror defaultAction(TypeMirror e, Void p) { return e; } }, null); } 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 boxIfPrimitive() { addProcessor( new TestProcessor() { @Override protected void run() { TypeMirror type = ctx.getMoreTypes().getPrimitiveType(TypeKind.INT); TypeMirror t1 = ctx.getMoreTypes().boxIfPrimitive(type); TypeMirror t2 = ctx.getMoreTypes().getTypeMirror(Integer.class); assertTrue(ctx.getMoreTypes().isSameType(t1, t2)); } }, new TestProcessor() { @Override protected void run() { TypeMirror t1 = ctx.getMoreTypes().getTypeMirror(Integer.class); TypeMirror t2 = ctx.getMoreTypes().boxIfPrimitive(t1); assertTrue(ctx.getMoreTypes().isSameType(t1, t2)); } }); }