int (@NotNull String propertyName, @NotNull String prefix) { int overlap = 0; int propertyNameLen = propertyName.length(); int prefixLen = prefix.length(); for (int j = 1; j < prefixLen && j < propertyNameLen; j++) { if (prefix.substring(prefixLen - j).equals(propertyName.substring(0, j))) { overlap = j; } } return overlap; }