String (@NotNull @Nls String name1, @NotNull @Nls String path1, @Nullable @Nls String parentPath1, @NotNull @Nls String name2, @NotNull @Nls String path2, @Nullable @Nls String parentPath2, @NotNull @Nls String sep) { if (path1.equals(path2)) return getContentTitle(name1, path1, parentPath1); if (Objects.equals(parentPath1, parentPath2)) { if (parentPath1 != null) { return name1 + sep + name2 + " (" + parentPath1 + ")"; } else { return path1 + sep + path2; } } else { if (name1.equals(name2)) { if (parentPath1 != null && parentPath2 != null) { return name1 + " (" + parentPath1 + sep + parentPath2 + ")"; } else { return path1 + sep + path2; } } else { if (parentPath1 != null && parentPath2 != null) { return name1 + sep + name2 + " (" + parentPath1 + sep + parentPath2 + ")"; } else { return path1 + sep + path2; } } } }