static Set<Path> getAllFiles(Set<Path> paths) throws IOException {
    Set<Path> expanded = new HashSet<>();
    for (Path path : paths) {
      if (Files.isRegularFile(path)) {
        expanded.add(path);
      } else if (Files.isDirectory(path)) {
        try (Stream<Path> dirWalk = Files.walk(path)) {
          dirWalk.filter(Files::isRegularFile).forEach(expanded::add);
        }
      }
    }
    return expanded;
  }
@Test
  public void getAllFiles_expandsDirectories() throws IOException {
    File rootFile = temporaryFolder.newFile("file");
    File folder = temporaryFolder.newFolder("folder");
    File folderFile = temporaryFolder.newFile("folder/file2");
    assertThat(
            PluginConfigurationProcessor.getAllFiles(
                ImmutableSet.of(rootFile.toPath(), folder.toPath())))
        .containsExactly(rootFile.toPath().toAbsolutePath(), folderFile.toPath().toAbsolutePath());
  }