code: public Map<String, Object> entityProps(ManagedObjectReference entityMor, String[] props)
              throws InvalidPropertyFaultMsg, RuntimeFaultFaultMsg {
          final HashMap<String, Object> retVal = new HashMap<>();
          // Create PropertyFilterSpec using the PropertySpec and ObjectPec
          PropertyFilterSpec[] propertyFilterSpecs = {new PropertyFilterSpecBuilder().propSet(
                  // Create Property Spec
                  new PropertySpecBuilder().all(false).type(entityMor.getType()).pathSet(props))
                  .objectSet(
                  // Now create Object Spec
                  new ObjectSpecBuilder().obj(entityMor))};
  
          List<ObjectContent> objCont = vimPort.retrievePropertiesEx(serviceContent.getPropertyCollector(),
                  Arrays.asList(propertyFilterSpecs), new RetrieveOptions()).getObjects();
  
          if (objCont != null) {
              for (ObjectContent oc : objCont) {
                  List<DynamicProperty> dps = oc.getPropSet();
                  for (DynamicProperty dp : dps) {
                      retVal.put(dp.getName(), dp.getVal());
                  }
              }
          }
  
          return retVal;
      }
docs: Method to retrieve properties of a {@link ManagedObjectReference}
  
  @param entityMor {@link ManagedObjectReference} of the entity
  @param props     Array of properties to be looked up
  @return Map of the property name and its corresponding value
  @throws InvalidPropertyFaultMsg If a property does not exist
  @throws RuntimeFaultFaultMsg