boolean (@NotNull String value) { List<String> words = StringUtil.split(value, " "); final int wordCount = words.size(); if (wordCount == 0) return true; if (Character.isLetter(words.get(0).charAt(0)) && !isCapitalizedWord(words.get(0))) return false; if (wordCount == 1) return true; int capitalized = 1; for (int i = 1; i < wordCount; i++) { String word = words.get(i); if (isCapitalizedWord(word)) { // check for abbreviations like 'C', 'SQL', 'I18n' if (word.length() == 1 || !Character.isLowerCase(word.charAt(1))) { continue; } capitalized++; } } // "Start service" if (capitalized == 1 && wordCount == 2) return true; final double ratio = ((double)capitalized - 1) / wordCount; return ratio <= 0.4; // allow reasonable amount of capitalized words }