List<LookupFile> (LookupFilter filter) { VirtualFile[] kids = myFile.getChildren(); List<LookupFile> result = new ArrayList<>(kids.length); for (VirtualFile each : kids) { LookupFile eachFile = new VfsFile(each); if (filter.isAccepted(eachFile)) { result.add(eachFile); } } result.sort((o1, o2) -> StringUtil.compare(o1.getName(), o2.getName(), !myFile.isCaseSensitive())); return result; }