docs: public void unregisterDeclaration(T declaration) {
          ServiceRegistration registration;
          synchronized (declarationsRegistered) {
              registration = declarationsRegistered.remove(declaration);
              if (registration == null) {
                  throw new IllegalStateException("The given Declaration has never been registered"
                          + "or have already been unregistered.");
              }
          }
          registration.unregister();
      }