Collection<String> () { LinkedHashSet<String> result = new LinkedHashSet<>(); for (VcsFileStatusInfo info : myStatusInfo) { result.add(info.getFirstPath()); if (info.getSecondPath() != null) result.add(info.getSecondPath()); } return result; }