String (@NotNull String name) { if (name.isEmpty() || ((name.length() > 1) && Character.isUpperCase(name.charAt(1)) && Character.isUpperCase(name.charAt(0)))) { return name; } char[] chars = name.toCharArray(); chars[0] = Character.toLowerCase(name.charAt(0)); return new String(chars); }