code: private String[] getServiceInterfaces(ServiceReference<ResourceFactory> ref) {
          Object createsObjectClass = ref.getProperty(ResourceFactory.CREATES_OBJECT_CLASS);
          if (createsObjectClass instanceof String[]) {
              Object createsObjectClassDefault = ref.getProperty("creates.objectClassDefault");
              if (createsObjectClassDefault instanceof String)
                  return new String[] { (String) createsObjectClassDefault };
              else if (createsObjectClassDefault instanceof String[])
                  return (String[]) createsObjectClassDefault;
              return (String[]) createsObjectClass;
          }
          if (createsObjectClass instanceof String) {
              return new String[] { (String) createsObjectClass };
          }
          return null;
      }
docs: Gets an array of resource service interfaces from a {@link ResourceFactory#CREATES_OBJECT_CLASS} value,
  possibly further refining to those listed under creates.objectClassDefault.
  Service property creates.objectClassDefault is added as a way to indicate that a subset of classes of creates.objectClass
  are compatible with the return type of ResourceFactory.createResource(null). This is useful for screening out
  creates.objectClass classes that can only be accessed with a resource ref type or resource env ref type.
  
  @param ref service reference to a resource factory.
  @return an array of service properties, or null if creates.compatibleClass/{@code createsObjectClass} is invalid