code: public static boolean validateSlices(ColumnSlice[] slices, CellNameType type, boolean reversed)
      {
          Comparator<Composite> comparator = reversed ? type.reverseComparator() : type;
  
          for (int i = 0; i < slices.length; i++)
          {
              Composite start = slices[i].start;
              Composite finish = slices[i].finish;
  
              if (start.isEmpty() || finish.isEmpty())
              {
                  if (start.isEmpty() && i > 0)
                      return false;
  
                  if (finish.isEmpty())
                      return i == slices.length - 1;
              }
              else
              {
                  // !finish.isEmpty() is imposed by prior loop
                  if (i > 0 && comparator.compare(slices[i - 1].finish, start) >= 0)
                      return false;
  
                  if (comparator.compare(start, finish) > 0)
                      return false;
              }
          }
          return true;
      }
docs: Validates that the provided slice array contains only non-overlapped slices valid for a query {@code reversed}
  or not on a table using {@code comparator}.