code: @SuppressWarnings("unchecked")
      public <C extends Capability> C getCapability(Class<C> capabilityType) {
          if (capabilityType.isInstance(this)) {
              return (C) this;
          }
          return null;
      }
docs: Default implementation checks if Repository implements Capability
  interface, and if so, returns the Repository.