code: public static boolean isDiamond(JCTree tree) {
          switch(tree.getTag()) {
              case TYPEAPPLY: return ((JCTypeApply)tree).getTypeArguments().isEmpty();
              case NEWCLASS: return isDiamond(((JCNewClass)tree).clazz);
              case ANNOTATED_TYPE: return isDiamond(((JCAnnotatedType)tree).underlyingType);
              default: return false;
          }
      }
docs: Return true if a tree represents a diamond new expr.