Couple<Boolean> (@NotNull final ProjectViewFileNestingService.NestingRule rule, @NotNull final String fileName) { String parentFileSuffix = rule.getParentFileSuffix(); String childFileSuffix = rule.getChildFileSuffix(); boolean matchesParent = /*!fileName.equalsIgnoreCase(parentFileSuffix) &&*/ StringUtil.endsWithIgnoreCase(fileName, parentFileSuffix); boolean matchesChild = /*!fileName.equalsIgnoreCase(childFileSuffix) &&*/ StringUtil.endsWithIgnoreCase(fileName, childFileSuffix); if (matchesParent && matchesChild) { if (parentFileSuffix.length() > childFileSuffix.length()) { matchesChild = false; } else { matchesParent = false; } } return Couple.of(matchesParent, matchesChild); }