private static Object[] sort(final Object[] items, HashMap<Object, Long> weights) {
    Arrays.sort(items, new LastUsedComparator(weights, Arrays.asList(items)));
    return items;
  }
private static Object[] sort(final Object[] items, HashMap<Object, Long> weights)