private static Map createMap(Collection accessibleObjects,
      boolean isConstructor)
  {
    final Map map = new HashMap();
    for (final Iterator i = accessibleObjects.iterator(); i.hasNext();)
    {
      final Member accessibleObject = (Member) i.next();

      if (!Modifier.isPublic(accessibleObject.getModifiers()))
        continue;

      final AccessibleObjectKey accessibleObjectKey;
      {
        // argCount determines the key
        int argCount = 0;
        {
          // The parameters determine the size of argCount
          final Class[] param;
          if (isConstructor)
          {
            param = ((Constructor) accessibleObject).getParameterTypes();
          }
          else
          {
            // If it is a method and the method was defined in Object(), skip
            // it.
            if (((Method) accessibleObject).getDeclaringClass() == Object.class)
            {
              continue;
            }
            param = ((Method) accessibleObject).getParameterTypes();
          }
          // don't count locally resolved args
          for (int n = 0; n < param.length; n++)
          {
            if (LocalArgController.isLocalArg(param[n]))
              continue;
            argCount++;
          }

          if (isConstructor)
          {
            // Since there is only one constructor name, we don't need to put a
            // name in.
            accessibleObjectKey = new AccessibleObjectKey(
                JSONRPCBridge.CONSTRUCTOR_FLAG, argCount);
          }
          else
          {
            // The key is the methods name and arg count
            accessibleObjectKey = new AccessibleObjectKey(
                ((Method) accessibleObject).getName(), argCount);
          }
        }
      }
      List marr = (ArrayList) map.get(accessibleObjectKey);
      if (marr == null)
      {
        marr = new ArrayList();
        map.put(accessibleObjectKey, marr);
      }
      
      marr.add(accessibleObject);
    }
    return map;
  }