if (!ok) throw new IllegalArgumentException();
provs = providers[cat]; if (provs == null) { result = true; provs = providers[cat] = new LinkedList(); } else result = false;  provs.add(provider); if (provider instanceof RegisterableService) ((RegisterableService) provider).onRegistration(this, category);  return result;
  public synchronized void registerServiceProvider(Object provider)  {    boolean ok = false;    if (provider == null)      throw new IllegalArgumentException();    for (int i = 0; i < categories.length; i++)      if (categories[i].isInstance(provider))        {          ok = true;          registerServiceProvider(provider, i);        }    if (!ok)      throw new IllegalArgumentException();  }