boolean (@NonNls String nameToCheck, @NonNls String secondName, int commonPrefixLength) { String nameToCheckLastPart = StringUtil.toLowerCase(nameToCheck.substring(commonPrefixLength)); if (!nameToCheckLastPart.contains(TESTDATA_FILE_AFTER_MARKER)) { return false; } String nameToCheckWithoutAfter = nameToCheckLastPart.replace(TESTDATA_FILE_AFTER_MARKER, ""); String nameToCheckExt = StringUtil.substringAfterLast(nameToCheck, "."); String nameToCheckWithoutAfterAndExt = StringUtil.substringBeforeLast(nameToCheckWithoutAfter, "."); String secondNameLastPart = StringUtil.toLowerCase(secondName.substring(commonPrefixLength)); String secondNameExt = nameToCheckExt == null ? secondNameLastPart : secondNameLastPart.replace(nameToCheckExt, ""); return !StringUtil.containsAlphaCharacters(nameToCheckWithoutAfterAndExt) && !StringUtil.containsAlphaCharacters(secondNameExt.replace(TESTDATA_FILE_BEFORE_MARKER, "")); }