docs: public void apply(List target, List tmp)
      {
          if (target.size() != length())
              throw new RuntimeException("target array does not have the same length as the index table");
          //fill tmp with the original ordering or target, adding when needed
          for (int i = 0; i < target.size(); i++)
              if (i >= tmp.size())
                  tmp.add(target.get(i));
              else
                  tmp.set(i, target.get(i));
          //place back into target from tmp to get sorted order
          for(int i = 0; i < target.size(); i++)
              target.set(i, tmp.get(index(i)));
      }