String (String name) { boolean lowercaseChars = false; int uppercaseChars = 0; for (int i = 0; i < name.length(); i++) { if (Character.isLowerCase(name.charAt(i))) { lowercaseChars = true; break; } if (Character.isUpperCase(name.charAt(i))) { uppercaseChars++; } } return !lowercaseChars && uppercaseChars >= 3 ? name : Character.toLowerCase(name.charAt(0)) + name.substring(1); }