docs: public static Method[] getMethods(Class<?> componentInterface,
                                        Class<?>[] businessInterfaces)
      {
          int numMethods = 0;
          Method[] methods = null;
          int numBusinessInterfaces = 0;
          HashMap<String, Method> methodNameTable = new HashMap<String, Method>();
  
          if (componentInterface != null)
          {
              methods = componentInterface.getMethods();
              numMethods = methods.length;
          }
  
          if (businessInterfaces != null)
          {
              numBusinessInterfaces = businessInterfaces.length;
          }
  
          ArrayList<Method> result = new ArrayList<Method>(numMethods + (numBusinessInterfaces * 10));
  
          //------------------------------------------------------------------------
          // First, iterate over the component interface methods (i.e. list
          // returned by "getMethods") and filter out methods belonging to the
          // EJBObject and EJBLocalObject interface, static methods, and
          // method synonyms.
          //
          // Method synonyms correspond to overrides. For all synonyms,
          // keep the method instance declared on the most specific class.
          // How do you determine the most specific class? Don't know.
          // For now, if the method is declared on the interface class
          // it always overrides others.
          //------------------------------------------------------------------------
  
          for (int i = 0; i < numMethods; i++)
          {
              Method m = methods[i];
  
              // Filter out static methods
              if (Modifier.isStatic(m.getModifiers())) {
                  continue;
              }
  
              String mKey = methodKey(m);
              String interfaceName = m.getDeclaringClass().getName();
              if (!interfaceName.equals("javax.ejb.EJBObject") && // f111627.1
                  !interfaceName.equals("javax.ejb.EJBLocalObject")) // f111627.1
              {
                  Method synonym = methodNameTable.get(mKey);
                  if (synonym == null)
                  {
                      methodNameTable.put(mKey, m);
                      result.add(m);
                  }
                  else
                  {
                      // Method declared on most specific class wins
                      Class<?> mClass = m.getDeclaringClass();
                      Class<?> sClass = synonym.getDeclaringClass();
                      if (sClass.isAssignableFrom(mClass))
                      {
                          methodNameTable.put(mKey, m);
                          result.set(result.indexOf(synonym), m);
                      }
                  }
              }
          }
  
          //------------------------------------------------------------------------
          // Second, iterate over the business interface methods (i.e. list
          // returned by "getMethods") and filter out static methods, and
          // method synonyms.                                              d366807.3
          //
          // Note: Business interfaces do NOT implement EJBObject or EJBLocalObject.
          //------------------------------------------------------------------------
  
          for (int i = 0; i < numBusinessInterfaces; ++i)
          {
              methods = businessInterfaces[i].getMethods();
              numMethods = methods.length;
              result.ensureCapacity(result.size() + numMethods);
  
              for (int j = 0; j < numMethods; j++)
              {
                  Method m = methods[j];
  
                  // Filter out static and bridge methods
                  if (Modifier.isStatic(m.getModifiers()) || m.isBridge()) {
                      continue;
                  }
  
                  // Filter out Object methods for No-Interface view         F743-1756
                  Class<?> declaring = m.getDeclaringClass();
                  if (declaring == Object.class) {
                      continue;
                  }
  
                  String mKey = methodKey(m);
  
                  // d583041 - The container is responsible for implementing these
                  // methods, so do not include them in business interfaces.
                  if ((mKey.equals("equals(java.lang.Object,)") && m.getReturnType() == Boolean.TYPE) ||
                      (mKey.equals("hashCode()") && m.getReturnType() == Integer.TYPE))
                  {
                      continue;
                  }
  
                  Method synonym = methodNameTable.get(mKey);
                  if (synonym == null)
                  {
                      methodNameTable.put(mKey, m);
                      result.add(m);
                  }
                  else
                  {
                      // Method declared on most specific class wins
                      Class<?> mClass = m.getDeclaringClass();
                      Class<?> sClass = synonym.getDeclaringClass();
                      if (sClass.isAssignableFrom(mClass))
                      {
                          methodNameTable.put(mKey, m);
                          result.set(result.indexOf(synonym), m);
                      }
                  }
              }
          }
  
          //------------------------------------------------------------------------
          // Finally, return the methods sorted alphabetically.
          //------------------------------------------------------------------------
  
          return sortMethods(result);
      }