boolean (@NotNull String name) { int prefixLength; if (name.startsWith(GET_PREFIX)) { prefixLength = 3; } else if (name.startsWith(IS_PREFIX)) { prefixLength = 2; } else { return false; } if (name.length() == prefixLength) return false; if (isUpperCase(name.charAt(prefixLength))) return true; return name.length() > prefixLength + 1 && isUpperCase(name.charAt(prefixLength + 1)); }