code: public boolean isOrdered(Iterable<InternalKey> keys)
      {
          Iterator<InternalKey> iterator = keys.iterator();
          if (!iterator.hasNext()) {
              return true;
          }
  
          InternalKey previous = iterator.next();
          while (iterator.hasNext()) {
              InternalKey next = iterator.next();
              if (compare(previous, next) > 0) {
                  return false;
              }
              previous = next;
          }
          return true;
      }
docs: Returns {@code true} if each element in {@code iterable} after the first is
  greater than or equal to the element that preceded it, according to this
  ordering. Note that this is always true when the iterable has fewer than
  two elements.