@Override
    public void listOrgs(IAsyncResultHandler<List<String>> handler) {
        // TODO: We should track set of OrgId -> AtomicCounter if this API has meaningfully high usage.
        List<String> res = map.values().stream()
                .map(elem -> {
                    if (elem instanceof Api) {
                        return ((Api) elem).getOrganizationId();
                    } else {
                        return ((Client) elem).getOrganizationId();
                    }
                })
                .distinct()
                .collect(Collectors.toList());
        handler.handle(AsyncResultImpl.create(res));
    }
@see io.apiman.gateway.engine.IRegistry#getContract(java.lang.String, java.lang.String, java.lang.String, java.lang.String, io.apiman.gateway.engine.async.IAsyncResultHandler)
gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/InMemoryRegistry.java