code: private static Collection<Path> findFiles(FileSystem fs, final String contains) throws IOException {
          final ArrayList<Path> rv = new ArrayList<>();
          Iterator<Path> dirs = fs.getRootDirectories().iterator();
          Files.walkFileTree(dirs.next(), new SimpleFileVisitor<Path>() {
              @Override
              public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
                  if (file.toString().contains(contains)) {
                      rv.add(file);
                  }
                  return FileVisitResult.CONTINUE;
              }
          });
          if (dirs.hasNext()) {
              // There is more than one root directory.
              throw new IOException("FileSystem had more than one root directory: " + fs);
          }
          return rv;
      }
docs: Find files in the given fs where the path contains the string <code>contains</code>.
  Will throw an IOException if the fs contains more than one root directory.