code: public static IntComparatorChain getChain(Table table, Sort key) {
          Iterator<Map.Entry<String, Sort.Order>> entries = key.iterator();
          Map.Entry<String, Sort.Order> sort = entries.next();
          Column<?> column = table.column(sort.getKey());
          IntComparator comparator = rowComparator(column, sort.getValue());
  
          IntComparatorChain chain = new IntComparatorChain(comparator);
          while (entries.hasNext()) {
              sort = entries.next();
              chain.addComparator(rowComparator(table.column(sort.getKey()), sort.getValue()));
          }
          return chain;
      }
docs: Returns a comparator chain for sorting according to the given key