private static boolean hasCapitals(String str) {
    for (int idx = 0; idx < str.length(); idx++) {
      if (Character.isUpperCase(str.charAt(idx))) {
        return true;
      }
    }
    return false;
  }
private static boolean hasCapitals(String str)