code: private static int getOrdering(int categoryOrder) {
          final int index = (categoryOrder & CATEGORY_MASK) >> CATEGORY_SHIFT;
  
          if (index < 0 || index >= sCategoryToOrder.length) {
              throw new IllegalArgumentException("order does not contain a valid category.");
          }
  
          return (sCategoryToOrder[index] << CATEGORY_SHIFT) | (categoryOrder & USER_MASK);
      }
docs: Returns the ordering across all items. This will grab the category from the upper bits, find
  out how to order the category with respect to other categories, and combine it with the lower
  bits.
  
  @param categoryOrder The category order for a particular item (if it has not been or/add with
  a category, the default category is assumed).
  @return An ordering integer that can be used to order this item across all the items (even
  from other categories).