JType implements Type, Type.ArrayType { @Override public boolean isNumerical() { switch (fullyQualifiedName()) { case "byte": case "char": case "short": case "int": case "long": case "float": case "double": return true; default: return false; } } 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 isNumerical() { assertAll( () -> assertThat(type("byte").isNumerical()).isTrue(), () -> assertThat(type("char").isNumerical()).isTrue(), () -> assertThat(type("short").isNumerical()).isTrue(), () -> assertThat(type("int").isNumerical()).isTrue(), () -> assertThat(type("long").isNumerical()).isTrue(), () -> assertThat(type("float").isNumerical()).isTrue(), () -> assertThat(type("double").isNumerical()).isTrue() ); }