code: private static Method[] sortMethods(ArrayList<Method> methods)
      {
          int numMethods = methods.size();
          Method result[] = new Method[numMethods];
  
          // Insert each element of given list of methods into result
          // array in sorted order.
  
          for (int i = 0; i < numMethods; i++)
          {
              Method currMethod = methods.get(i);
              String currMethodName = currMethod.toString();
              int insertIndex = 0;
              while (insertIndex < i)
              {
                  if (currMethodName.compareTo(result[insertIndex].toString()) <= 0)
                  {
                      break;
                  }
                  insertIndex++;
              }
              for (int j = insertIndex; j <= i; j++)
              {
                  Method tmpMethod = result[j];
                  result[j] = currMethod;
                  currMethod = tmpMethod;
              }
          }
          return result;
      }
docs: d366807.3