code: public String[] list(FilenameFilter filter) {
          String[] filenames = list();
          if (filter == null || filenames == null) {
              return filenames;
          }
          List<String> result = new ArrayList<String>(filenames.length);
          for (String filename : filenames) {
              if (filter.accept(this, filename)) {
                  result.add(filename);
              }
          }
          return result.toArray(new String[result.size()]);
      }
docs: Gets a list of the files in the directory represented by this file. This
  list is then filtered through a FilenameFilter and the names of files
  with matching names are returned as an array of strings. Returns
  {@code null} if this file is not a directory. If {@code filter} is
  {@code null} then all filenames match.
  <p>
  The entries {@code .} and {@code ..} representing the current and parent
  directories are not returned as part of the list.
  
  @param filter
  the filter to match names against, may be {@code null}.
  @return an array of files or {@code null}.