public static boolean isType(Element element) {
    return element.getKind().isClass() || element.getKind().isInterface();
  }
Returns true if the given {@link Element} instance is a {@link TypeElement}.

<p>This method is functionally equivalent to an {@code instanceof} check, but should
always be used over that idiom as instructed in the documentation for {@link Element}.
value-processor/src/org/immutables/value/processor/meta/MoreElements.java