public static boolean isCapitalized(@NotNull String text, @NotNull TextRange range) {
    if (range.getLength() == 0) return false;
    CharacterIterator it = new StringCharacterIterator(text, range.getStartOffset() + 1, range.getEndOffset(), range.getStartOffset() + 1);
    boolean lowCase = true;
    for (char c = it.first(); c != CharacterIterator.DONE; c = it.next()) {
      lowCase = Character.isLowerCase(c);
    }

    return Character.isUpperCase(text.charAt(range.getStartOffset())) && lowCase;
  }
public static boolean isCapitalized(@NotNull String text, @NotNull TextRange range)