JBIterable<VirtualFile> (@NotNull VcsTreeModelData data) { return data.iterateUserObjects() .map(object -> { if (object instanceof VirtualFile) return (VirtualFile)object; if (object instanceof FilePath) return ((FilePath)object).getVirtualFile(); return null; }) .filterNotNull() .filter(VirtualFile::isValid); }