private static boolean isJavaIdentifier(final String token)
    {
        if (token.isEmpty())
        {
            return false;
        }

        for (int i = 0, size = token.length(); i < size; i++)
        {
            final char c = token.charAt(i);

            if (i == 0 && Character.isJavaIdentifierStart(c))
            {
                continue;
            }

            if (Character.isJavaIdentifierPart(c))
            {
                continue;
            }

            return false;
        }

        return true;
    }
Is this token a Java keyword?

@param token to be tested.
@return true if a Java keyword otherwise false.
sbe-tool/src/main/java/uk/co/real_logic/sbe/ValidationUtil.java