docs: public static <T> List<List<T>> getPrefixesAndSuffixes(List<T> items, int minSize, int maxSize, T paddingSymbol, boolean includePrefixes, boolean includeSuffixes) {
      assert minSize > 0;
      assert maxSize >= minSize;
      assert includePrefixes || includeSuffixes;
  
      List<List<T>> prefixesAndSuffixes = new ArrayList<List<T>>();
      for (int span = minSize - 1; span < maxSize; span++) {
        List<Integer> indices = new ArrayList<Integer>();
        List<T> seq = new ArrayList<T>();
        if (includePrefixes) {
          for (int i = 0; i <= span; i++) {
            indices.add(i);
          }
        }
        if (includeSuffixes) {
          int maxIndex = items.size() - 1;
          for (int i = span; i >= 0; i--) {
            indices.add(maxIndex - i);
          }
        }
  
        for (int i : indices) {
          try {
            seq.add(items.get(i));
          } catch (IndexOutOfBoundsException ioobe) {
            seq.add(paddingSymbol);
          }
        }
  
        prefixesAndSuffixes.add(seq);
      }
  
      return prefixesAndSuffixes;
    }