code: @Override
      public Iterable<JavaFileObject> list(JavaFileManager.Location location,
              String packageName,
              Set<JavaFileObject.Kind> kinds,
              boolean recurse)
              throws IOException {
          Iterable<JavaFileObject> stdList = stdFileManager.list(location, packageName, kinds, recurse);
          if (location==CLASS_PATH && packageName.equals("REPL")) {
              // if the desired list is for our JShell package, lazily iterate over
              // first the standard list then any generated classes.
              return () -> new Iterator<JavaFileObject>() {
                  boolean stdDone = false;
                  Iterator<? extends JavaFileObject> it;
  
                  @Override
                  public boolean hasNext() {
                      if (it == null) {
                          it = stdList.iterator();
                      }
                      if (it.hasNext()) {
                          return true;
                      }
                      if (stdDone) {
                          return false;
                      } else {
                          stdDone = true;
                          it = generatedClasses().iterator();
                          return it.hasNext();
                      }
                  }
  
                  @Override
                  public JavaFileObject next() {
                      if (!hasNext()) {
                          throw new NoSuchElementException();
                      }
                      return it.next();
                  }
  
              };
          } else {
              return stdList;
          }
      }
docs: Lists all file objects matching the given criteria in the given
  location.  List file objects in "subpackages" if recurse is
  true.
  
  <p>Note: even if the given location is unknown to this file
  manager, it may not return {@code null}.  Also, an unknown
  location may not cause an exception.
  
  @param location     a location
  @param packageName  a package name
  @param kinds        return objects only of these kinds
  @param recurse      if true include "subpackages"
  @return an Iterable of file objects matching the given criteria
  @throws IOException if an I/O error occurred, or if {@link
  #close} has been called and this file manager cannot be
  reopened
  @throws IllegalStateException if {@link #close} has been called
  and this file manager cannot be reopened