@CanIgnoreReturnValue
  public PathSubject hasChildren(String... children) throws IOException {
    isDirectory();

    List<Path> expectedNames = new ArrayList<>();
    for (String child : children) {
      expectedNames.add(actual.getFileSystem().getPath(child));
    }

    try (DirectoryStream<Path> stream = Files.newDirectoryStream(actual)) {
      List<Path> actualNames = new ArrayList<>();
      for (Path path : stream) {
        actualNames.add(path.getFileName());
      }

      if (!actualNames.equals(expectedNames)) {
        failWithoutActual(
            fact("expected to have children", expectedNames),
            fact("but had children", actualNames),
            fact("for path", actual));
      }
    }
    return this;
  }
Asserts that the directory has children with the given names, in the given order.
jimfs/src/test/java/com/google/common/jimfs/PathSubject.java