code: public <T extends ServiceConfiguration<?>> T getExistingServiceConfiguration(Class<T> clazz) {
      for (ServiceConfiguration<?> serviceConfiguration : serviceConfigurations) {
        if (clazz.equals(serviceConfiguration.getClass())) {
          return clazz.cast(serviceConfiguration);
        }
      }
      return null;
    }
docs: Returns the first {@link ServiceConfiguration} with type matching the class passed in.
  
  @param clazz the service configuration class
  @param <T> the type of the service configuration
  @return a matching service configuration, or {@code null} if none can be found