code: protected File[] sort(File[] files) {
  
      Arrays.sort(files, (fileOne, fileTwo) -> {
  
        if (fileOne.isDirectory() && fileTwo.isDirectory()) {
          return fileOne.getName().compareTo(fileTwo.getName());
        }
        else if (fileOne.isDirectory()) {
          return -1;
        }
        else if (fileTwo.isDirectory()) {
          return 1;
        }
        else {
          return fileOne.getName().compareTo(fileTwo.getName());
        }
      });
  
      return files;
    }
docs: Sorts the given array of {@link File Files}, ordered by directory first, files second and name last.
  
  @param files array of {@link File Files} to sort; array must not be {@literal null}
  or contain {@literal null} {@link File Files}.
  @return the sorted array of {@link File Files}.
  @see java.util.Arrays#sort(Object[], Comparator)
  @see java.io.File