code: public static SingleTaskDataPublisher getInstance(Class<? extends DataPublisher> dataPublisherClass, State state)
        throws ReflectiveOperationException {
      Preconditions.checkArgument(SingleTaskDataPublisher.class.isAssignableFrom(dataPublisherClass),
          String.format("Cannot instantiate %s since it does not extend %s", dataPublisherClass.getSimpleName(),
              SingleTaskDataPublisher.class.getSimpleName()));
  
      return (SingleTaskDataPublisher) DataPublisher.getInstance(dataPublisherClass, state);
    }
docs: Get an instance of {@link SingleTaskDataPublisher}.
  
  @param dataPublisherClass A concrete class that extends {@link SingleTaskDataPublisher}.
  @param state A {@link State} used to instantiate the {@link SingleTaskDataPublisher}.
  @return A {@link SingleTaskDataPublisher} instance.
  @throws ReflectiveOperationException