code: public static ValidationResult validateIdentifier(String identifier, IdentifierType type)
     {
        if (Strings.isNullOrEmpty(identifier))
           return new ValidationResult(ERROR, Messages.notNullOrEmpty(type));
        if (isReservedWord(identifier))
        {
           return new ValidationResult(ERROR, Messages.isAJavaKeyWord(identifier));
        }
        int javaLetter = identifier.codePointAt(0);
        if (!Character.isJavaIdentifierStart(javaLetter))
        {
           return new ValidationResult(ERROR, Messages.containsInvalidCharacters(identifier));
        }
        for (int ctr = 1; ctr < identifier.length(); ctr++)
        {
           int javaLetterOrDigit = identifier.codePointAt(ctr);
           if (!Character.isJavaIdentifierPart(javaLetterOrDigit))
           {
              return new ValidationResult(ERROR, Messages.containsInvalidCharacters(identifier));
           }
        }
        if (CLASS_NAME.equals(type) && identifier.contains("$"))
        {
           return new ValidationResult(WARNING, "The use of '$' in class names is discouraged.");
        }
        else
        {
           return new ValidationResult(INFO);
        }
     }
docs: Validates whether the <code>identifier</code> parameter is a valid identifier name for the <code>type</code>
  parameter.
  
  @param identifier
  @param type
  @return