class RunConfigUtil {
  private static final String DEFAULT_RESTART_POLICY = "Always";

  private RunConfigUtil() {
  }

  public static ObjectMeta getObjectMetadataFromRunConfig(RunConfig generatorRunConfig) {
    ObjectMetaBuilder objectMetaBuilder = new ObjectMetaBuilder();
    if (generatorRunConfig.getName() != null) {
      objectMetaBuilder.withName(generatorRunConfig.getName());
      objectMetaBuilder.addToLabels("run", generatorRunConfig.getName());
    }

    if (generatorRunConfig.getLabels() != null) {
      objectMetaBuilder.addToLabels(generatorRunConfig.getLabels());
    }

    return objectMetaBuilder.build();
  }

  public static PodSpec getPodSpecFromRunConfig(RunConfig generatorRunConfig) {
    PodSpecBuilder podSpecBuilder = new PodSpecBuilder();
    if (generatorRunConfig.getRestartPolicy() != null) {
      podSpecBuilder.withRestartPolicy(generatorRunConfig.getRestartPolicy());
    } else {
      podSpecBuilder.withRestartPolicy(DEFAULT_RESTART_POLICY);
    }

    if (generatorRunConfig.getServiceAccount() != null) {
      podSpecBuilder.withServiceAccountName(generatorRunConfig.getServiceAccount());
    }

    podSpecBuilder.addToContainers(containerFromConfig(generatorRunConfig));

    return podSpecBuilder.build();
  }

  static Container containerFromConfig(RunConfig runConfig) {
    final ContainerBuilder containerBuilder = new ContainerBuilder();
    containerBuilder.withName(runConfig.getName());
    containerBuilder.withImage(runConfig.getImage());
    containerBuilder.withImagePullPolicy(runConfig.getImagePullPolicy());
    containerBuilder.withArgs(argsFromConfig(runConfig));
    containerBuilder.withCommand(commandFromConfig(runConfig));

    if (runConfig.getEnv() != null) {
      containerBuilder.withEnv(KubernetesResourceUtil.convertMapToEnvVarList(runConfig.getEnv()));
    }

    if (runConfig.getPort() > 0) {
      containerBuilder.withPorts(new ContainerPortBuilder()
          .withContainerPort(runConfig.getPort())
          .build());
    }

    if (runConfig.getLimits() != null) {
      containerBuilder.editOrNewResources()
          .addToLimits(runConfig.getLimits())
          .endResources();
    }

    if (runConfig.getRequests() != null) {
      containerBuilder.editOrNewResources()
          .addToRequests(runConfig.getRequests())
          .endResources();
    }
    return containerBuilder.build();
  }

  private static String[] argsFromConfig(RunConfig runConfig) {<FILL_FUNCTION_BODY>}

  private static String[] commandFromConfig(RunConfig runConfig) {
    if (isNotNullOrEmpty(runConfig.getCommand())) {
      final List<String> command = new ArrayList<>(Collections.singletonList(runConfig.getCommand()));
      if (runConfig.getArgs() != null) {
        command.addAll(runConfig.getArgs());
      }
      return command.toArray(new String[0]);
    }
    return new String[0];
  }
}

    if (isNullOrEmpty(runConfig.getCommand()) && runConfig.getArgs() != null) {
      return runConfig.getArgs().toArray(new String[0]);
    }
    return new String[0];
  
<no_super_class>