code: public static DesiredCapabilities retrieveCustomCapabilities(Class<? extends DefaultCapabilitiesBuilder> builder) {
          logger.entering(builder);
  
          DesiredCapabilities caps = new DesiredCapabilities();
          if (builder != null && !builder.getName().equals(DefaultCapabilitiesBuilder.class.getName())) {
              try {
                  caps = builder.newInstance().createCapabilities();
              } catch (InstantiationException | IllegalAccessException e) {
                  throw new IllegalStateException("Unable to apply desired capabilities from " + builder.getName(), e);
              }
          }
  
          logger.exiting(caps);
          return caps;
      }
docs: Acquire capabilities from a {@link DefaultCapabilitiesBuilder} provider.
  
  @param builder
  the {@link DefaultCapabilitiesBuilder} provider to acquire capabilities from
  @return the {@link DesiredCapabilities} which came from the providers.