code: public static <K,V extends Item> Map<K,V> loadChildren(ItemGroup parent, File modulesDir, Function1<? extends K,? super V> key) {
          modulesDir.mkdirs(); // make sure it exists
  
          File[] subdirs = modulesDir.listFiles(new FileFilter() {
              public boolean accept(File child) {
                  return child.isDirectory();
              }
          });
          CopyOnWriteMap.Tree<K,V> configurations = new CopyOnWriteMap.Tree<>();
          for (File subdir : subdirs) {
              try {
                  // Try to retain the identity of an existing child object if we can.
                  V item = (V) parent.getItem(subdir.getName());
                  if (item == null) {
                      XmlFile xmlFile = Items.getConfigFile(subdir);
                      if (xmlFile.exists()) {
                          item = (V) Items.load(parent, subdir);
                      } else {
                          Logger.getLogger(ItemGroupMixIn.class.getName()).log(Level.WARNING, "could not find file " + xmlFile.getFile());
                          continue;
                      }
                  } else {
                      item.onLoad(parent, subdir.getName());
                  }
                  configurations.put(key.call(item), item);
              } catch (Exception e) {
                  Logger.getLogger(ItemGroupMixIn.class.getName()).log(Level.WARNING, "could not load " + subdir, e);
              }
          }
  
          return configurations;
      }
docs: Loads all the child {@link Item}s.
  
  @param modulesDir
  Directory that contains sub-directories for each child item.