### Question:
MoreTypes { public static boolean isConversionFromObjectUnchecked(TypeMirror type) { return new CastingUncheckedVisitor().visit(type, null); } private  MoreTypes(); static Equivalence<TypeMirror> equivalence(); static ImmutableSet<TypeElement> referencedTypes(TypeMirror type); static Element asElement(TypeMirror typeMirror); static TypeElement asTypeElement(TypeMirror mirror); static ImmutableSet<TypeElement> asTypeElements(Iterable<? extends TypeMirror> mirrors); static ArrayType asArray(TypeMirror maybeArrayType); static DeclaredType asDeclared(TypeMirror maybeDeclaredType); static ErrorType asError(TypeMirror maybeErrorType); static ExecutableType asExecutable(TypeMirror maybeExecutableType); static IntersectionType asIntersection(TypeMirror maybeIntersectionType); static NoType asNoType(TypeMirror maybeNoType); static NullType asNullType(TypeMirror maybeNullType); static PrimitiveType asPrimitiveType(TypeMirror maybePrimitiveType); static TypeVariable asTypeVariable(TypeMirror maybeTypeVariable); static WildcardType asWildcard(TypeMirror maybeWildcardType); static boolean isType(TypeMirror type); static boolean isTypeOf(final Class<?> clazz, TypeMirror type); static Optional<DeclaredType> nonObjectSuperclass(Types types, Elements elements,
      DeclaredType type); static TypeMirror asMemberOf(Types types, DeclaredType container,
      VariableElement variable); static boolean isConversionFromObjectUnchecked(TypeMirror type);  }### Answer:
@Test public void testIsConversionFromObjectUnchecked_yes() { Elements elements = compilationRule.getElements(); TypeElement unchecked = elements.getTypeElement(Unchecked.class.getCanonicalName()); for (VariableElement field : ElementFilter.fieldsIn(unchecked.getEnclosedElements())) { TypeMirror type = field.asType(); expect .withMessage("Casting to %s is unchecked", type) .that(MoreTypes.isConversionFromObjectUnchecked(type)) .isTrue(); } }
@Test public void testIsConversionFromObjectUnchecked_no() { Elements elements = compilationRule.getElements(); TypeElement notUnchecked = elements.getTypeElement(NotUnchecked.class.getCanonicalName()); for (VariableElement field : ElementFilter.fieldsIn(notUnchecked.getEnclosedElements())) { TypeMirror type = field.asType(); expect .withMessage("Casting to %s is not unchecked", type) .that(MoreTypes.isConversionFromObjectUnchecked(type)) .isFalse(); } }