code: @Override
    public <E> List<E> sort(final List<E> elements) {
      for (int gap = getGap(elements); gap > 0; gap /= 2) {
        for (int i = gap, size = elements.size(); i < size; i++) {
          E elementAtI = elements.get(i);
          int j = i;
  
          for ( ; j >= gap && getOrderBy().compare(elements.get(j - gap), elementAtI) > 0; j -= gap) {
            elements.set(j, elements.get(j - gap));
          }
  
          elements.set(j, elementAtI);
        }
      }
  
      return elements;
    }
docs: Uses the Shell (Insertion) Sort algorithm to sort a List of elements as defined by the Comparator, or as determined
  by the elements in the collection if the elements are Comparable.
  
  @param <E> the type of elements in the List.
  @param elements the List of elements to sort.
  @return the collection of elements sorted.
  @see java.util.List