@Test
  public void isTypeOf_primitiveAndBoxedPrimitiveTypes() {
    class PrimitiveTypeInfo {
      final Class<?> CLASS_TYPE;
      final Class<?> BOXED_CLASS_TYPE;
      final TypeKind TYPE_KIND;

      PrimitiveTypeInfo(Class<?> classType, Class<?> boxedClassType, TypeKind typeKind) {
        this.CLASS_TYPE = classType;
        this.BOXED_CLASS_TYPE = boxedClassType;
        this.TYPE_KIND = typeKind;
      }
    }
    final List<PrimitiveTypeInfo> primitivesTypeInfo =
        ImmutableList.of(
            new PrimitiveTypeInfo(Byte.TYPE, Byte.class, TypeKind.BYTE),
            new PrimitiveTypeInfo(Short.TYPE, Short.class, TypeKind.SHORT),
            new PrimitiveTypeInfo(Integer.TYPE, Integer.class, TypeKind.INT),
            new PrimitiveTypeInfo(Long.TYPE, Long.class, TypeKind.LONG),
            new PrimitiveTypeInfo(Float.TYPE, Float.class, TypeKind.FLOAT),
            new PrimitiveTypeInfo(Double.TYPE, Double.class, TypeKind.DOUBLE),
            new PrimitiveTypeInfo(Boolean.TYPE, Boolean.class, TypeKind.BOOLEAN),
            new PrimitiveTypeInfo(Character.TYPE, Character.class, TypeKind.CHAR));

    for (boolean isBoxedI : new boolean[] {false, true}) {
      for (int i = 0; i < primitivesTypeInfo.size(); i++) { // For the Class<?> arg
        Class<?> clazz =
            isBoxedI
                ? primitivesTypeInfo.get(i).BOXED_CLASS_TYPE
                : primitivesTypeInfo.get(i).CLASS_TYPE;

        for (boolean isBoxedJ : new boolean[] {false, true}) {
          for (int j = 0; j < primitivesTypeInfo.size(); j++) { // For the TypeMirror arg
            TypeKind typeKind = primitivesTypeInfo.get(j).TYPE_KIND;
            TypeMirror typeMirror =
                isBoxedJ
                    ? typeUtils.boxedClass(typeUtils.getPrimitiveType(typeKind)).asType()
                    : typeUtils.getPrimitiveType(typeKind);

            String message =
                "Mirror:\t" + typeMirror.toString() + "\nClass:\t" + clazz.getCanonicalName();
            if (isBoxedI == isBoxedJ && i == j) {
              assertWithMessage(message).that(MoreTypes.isTypeOf(clazz, typeMirror)).isTrue();
            } else {
              assertWithMessage(message).that(MoreTypes.isTypeOf(clazz, typeMirror)).isFalse();
            }
          }
        }
      }
    }
  }
Tests {@link MoreTypes#isTypeOf(Class, TypeMirror)}.
common/src/test/java/com/google/auto/common/MoreTypesIsTypeOfTest.java