code: public static boolean isValidJavaIdentifier(String str) {
      if (isNullOrEmpty(str)) {
        return false;
      }
      if (JAVA_KEYWORDS.contains(str)) {
        return false;
      }
      if (!Character.isJavaIdentifierStart(str.charAt(0))) {
        return false;
      }
      for (int i = 1; i < str.length(); i++) {
        if (!Character.isJavaIdentifierPart(str.charAt(i))) {
          return false;
        }
      }
      return true;
    }
docs: Returns true if the string is a valid Java identifier. See <a
  href="https://docs.oracle.com/cd/E19798-01/821-1841/bnbuk/index.html">Identifiers</a>
  
  @param str the string to be examined
  @return true if str is a valid Java identifier