Collection<VirtualFile> (boolean includeSources, boolean includeBinaries) { if (includeSources && includeBinaries) { Collection<VirtualFile> sourceRoots = getSourceRoots(); Collection<VirtualFile> binaryRoots = getBinaryRoots(); if (binaryRoots.isEmpty()) { return sourceRoots; } if (sourceRoots.isEmpty()) { return binaryRoots; } return ContainerUtil.union(sourceRoots, binaryRoots); } if (includeSources) { return getSourceRoots(); } if (includeBinaries) { return getBinaryRoots(); } return Collections.emptySet(); }