private void checkEmpty(Directory dir, Path pathForException) throws FileSystemException {
    if (!dir.isEmpty()) {
      throw new DirectoryNotEmptyException(pathForException.toString());
    }
  }
Checks that given directory is empty, throwing {@link DirectoryNotEmptyException} if not.
jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java