JType implements Type, Type.ArrayType { @Override public boolean isClass() { return typeBinding.isClass() || typeBinding.isInterface() || typeBinding.isEnum(); } JType(JSema sema, ITypeBinding typeBinding); @Override boolean is(String fullyQualifiedName); @Override boolean isSubtypeOf(String fullyQualifiedName); @Override boolean isSubtypeOf(Type superType); @Override boolean isArray(); @Override boolean isClass(); @Override boolean isVoid(); @Override boolean isPrimitive(); @Override boolean isPrimitive(Primitives primitive); @Override boolean isUnknown(); @Override boolean isNumerical(); @Override String fullyQualifiedName(); @Override String name(); @Override String toString(); @Override Symbol.TypeSymbol symbol(); @Override Type erasure(); @Override Type elementType(); @Override boolean equals(Object obj); @Override int hashCode(); @Override boolean isParameterized(); @Override List<Type> typeArguments();  }
@Test void isClass() { assertAll( () -> assertThat(type("java.util.HashMap").isClass()) .as("for classes") .isTrue(), () -> assertThat(type("java.util.Map").isClass()) .as("for interfaces") .isTrue(), () -> assertThat(type("java.lang.annotation.RetentionPolicy").isClass()) .as("for enums") .isTrue() ); }