code: public static Optional<TaskFactory> getTaskFactory(State state) {
      try {
        if (state.contains(TASK_FACTORY_CLASS)) {
          return Optional.of((TaskFactory) Class.forName(state.getProp(TASK_FACTORY_CLASS)).newInstance());
        } else {
          return Optional.absent();
        }
      } catch (ReflectiveOperationException roe) {
        throw new RuntimeException("Could not create task factory.", roe);
      }
    }
docs: Parse the {@link TaskFactory} in the state if one is defined.