code: public static List<ServiceModel> services(BundleContext context) {
          List<ServiceModel> services = new ArrayList<>();
          try {
              ServiceReference[] references = context.getAllServiceReferences(null, null);
              if (references != null) {
                  for (ServiceReference ref : references) {
                      services.add(new ServiceModel(ref));
                  }
              }
          } catch (InvalidSyntaxException e) {  //NOSONAR
              // Ignore it.
          }
          return services;
      }
docs: Creates the list of service models from the list of the currently available services.
  
  @param context the bundle context
  @return the list of models