code: public static <INPUT extends Comparable<INPUT>> List<INPUT> toUniqueAndSortedList(Iterable<INPUT> inputs) {
      if (inputs instanceof Set) {
        // inputs are unique but order is not enforced
        return Ordering.natural().immutableSortedCopy(inputs);
      }
      // inputs are not unique and order is not guaranteed
      return Ordering.natural().immutableSortedCopy(Sets.newHashSet(inputs));
    }
docs: Ensure values {@code inputs} are unique (which avoids useless arguments) and sorted so that there is little
  variations of SQL requests over time as possible with a IN clause and/or a group of OR clauses. Such requests can
  then be more easily optimized by the SGDB engine.