docs: @SuppressWarnings({ "unchecked", "rawtypes" })
      public static void sortByRankingOrder(ServiceReference<?>[] refs) {
          if (refs.length > 1) {
              ConcurrentServiceReferenceElement[] tmp = new ConcurrentServiceReferenceElement[refs.length];
  
              // Take a snapshot of the service rankings.
              for (int i = 0; i < refs.length; i++) {
                  tmp[i] = new ConcurrentServiceReferenceElement(null, refs[i]);
              }
  
              Arrays.sort(tmp);
  
              // Copy the sorted service references.
              for (int i = 0; i < refs.length; i++) {
                  refs[i] = tmp[i].getReference();
              }
          }
      }