code: @NotNull
      public static ObjectContent[] getObjectProperties(ConnectionResources connectionResources,
                                                        ManagedObjectReference mor,
                                                        String[] properties)
              throws RuntimeFaultFaultMsg, InvalidPropertyFaultMsg {
          if (mor == null) {
              return new ObjectContent[0];
          }
  
          PropertyFilterSpec spec = new PropertyFilterSpec();
          spec.getPropSet().add(new PropertySpec());
  
          if ((properties == null || properties.length == 0)) {
              spec.getPropSet().get(0).setAll(true);
          } else {
              spec.getPropSet().get(0).setAll(false);
          }
  
          spec.getPropSet().get(0).setType(mor.getType());
          spec.getPropSet().get(0).getPathSet().addAll(Arrays.asList(properties));
          spec.getObjectSet().add(new ObjectSpec());
          spec.getObjectSet().get(0).setObj(mor);
          spec.getObjectSet().get(0).setSkip(false);
  
          List<PropertyFilterSpec> propertyFilterSpecs = new ArrayList<>(1);
          propertyFilterSpecs.add(spec);
          List<ObjectContent> objectContentList = retrievePropertiesAllObjects(connectionResources, propertyFilterSpecs);
  
          return objectContentList.toArray(new ObjectContent[objectContentList.size()]);
      }
docs: Retrieve contents for a single object based on the property collector
  registered with the service.
  
  @param mor        Managed Object Reference to get contents for
  @param properties names of properties of object to retrieve
  @return retrieved object contents