code: @Override
    public <E> List<E> sort(final List<E> elements) {
      int position = elements.size();
  
      do {
        int lastSwapPosition = 0;
  
        for (int index = 1; index < position; index++) {
          if (getOrderBy().compare(elements.get(index - 1), elements.get(index)) > 0) {
            swap(elements, index - 1, index);
            lastSwapPosition = index;
          }
        }
  
        position = lastSwapPosition;
      }
      while (position != 0);
  
      return elements;
    }
docs: Uses the Bubble 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