docs: @Override
      public List<ServiceInstance> getAllInstancesByMetadataKey(ServiceInstanceQuery query)
              throws ServiceException {
          
          ServiceInstanceUtils.validateManagerIsStarted(isStarted);
          validateServiceInstanceMetadataQuery(query);
  
          String keyName = null;
          if (query.getCriteria().size() > 0) {
              keyName = query.getCriteria().get(0).getMetadataKey();
          }
          if (keyName != null && !keyName.isEmpty()) {
              List<ModelServiceInstance> modelInstances = getLookupService()
                      .getModelInstancesByMetadataKey(keyName);
              List<ModelServiceInstance> filteredInstances = ServiceInstanceQueryHelper
                      .filter(query, modelInstances);
              List<ServiceInstance> instances = new ArrayList<ServiceInstance>();
              for (ModelServiceInstance model : filteredInstances) {
                  instances.add(ServiceInstanceUtils.toServiceInstance(model));
              }
              return instances;
          }
          return Collections.<ServiceInstance>emptyList();
      }