public static ApplicationDescriptorImpl<? extends ApplicationDescriptor> getAppDescriptor(SamzaApplication app, Config config) {
    if (app instanceof StreamApplication) {
      return new StreamApplicationDescriptorImpl((StreamApplication) app, config);
    }
    if (app instanceof TaskApplication) {
      return new TaskApplicationDescriptorImpl((TaskApplication) app, config);
    }
    throw new IllegalArgumentException(String.format("User application class %s is not supported. Only StreamApplication "
        + "and TaskApplication are supported.", app.getClass().getName()));
  }
Create a new instance of {@link ApplicationDescriptorImpl} based on {@link SamzaApplication} and {@link Config}

@param app an implementation of {@link SamzaApplication}. The {@code app} has to have a proper fully-qualified class name.
@param config the {@link Config} for the application
@return the {@link ApplicationDescriptorImpl} instance containing the processing logic and the config
samza-core/src/main/java/org/apache/samza/application/descriptors/ApplicationDescriptorUtil.java