List<Path> (@NotNull Path directory) { try { List<Path> files = new ArrayList<>(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(directory)) { for (Path path : stream) files.add(path); } return files; } catch (IOException e) { return Collections.emptyList(); } }