Source:
<code>private void prepareCommand(final TaskInfo.Builder bldr, final SingularityTaskId taskId, final SingularityTaskRequest task, final SingularityOfferHolder offerHolder, final Optional<long[]> ports) { CommandInfo.Builder commandBldr = CommandInfo.newBuilder(); if (task.getDeploy().getUser().isPresent()) { commandBldr.setUser(task.getDeploy().getUser().get()); } if (task.getDeploy().getCommand().isPresent()) { commandBldr.setValue(task.getDeploy().getCommand().get()); } if (task.getDeploy().getArguments().isPresent()) { commandBldr.addAllArguments(task.getDeploy().getArguments().get()); } if (task.getPendingTask().getCmdLineArgsList().isPresent()) { commandBldr.addAllArguments(task.getPendingTask().getCmdLineArgsList().get()); } if (task.getDeploy().getShell().isPresent()){ commandBldr.setShell(task.getDeploy().getShell().get()); } else if ((task.getDeploy().getArguments().isPresent() && !task.getDeploy().getArguments().get().isEmpty()) || task.getDeploy().getContainerInfo().isPresent() || (task.getPendingTask().getCmdLineArgsList().isPresent() && !task.getPendingTask().getCmdLineArgsList().get().isEmpty())) { commandBldr.setShell(false); } List<SingularityMesosArtifact> combinedArtifacts = task.getDeploy().getUris().or(Collections.<SingularityMesosArtifact> emptyList()); <START> combinedArtifacts.addAll(task.getPendingTask().getExtraArtifacts().or(Collections.<SingularityMesosArtifact> emptyList())); <END> for (SingularityMesosArtifact artifact : combinedArtifacts) { commandBldr.addUris(URI.newBuilder() .setValue(artifact.getUri()) .setCache(artifact.isCache()) .setExecutable(artifact.isExecutable()) .setExtract(artifact.isExtract()) .build()); } prepareEnvironment(task, taskId, commandBldr, offerHolder, ports); bldr.setCommand(commandBldr); }</code><technical_language>longer need <...> in Java 8</technical_language>

Target:
private void prepareCommand(final TaskInfo.Builder bldr, final SingularityTaskId taskId, final SingularityTaskRequest task, final SingularityOfferHolder offerHolder, final Optional<long[]> ports) { CommandInfo.Builder commandBldr = CommandInfo.newBuilder(); if (task.getDeploy().getUser().isPresent()) { commandBldr.setUser(task.getDeploy().getUser().get()); } if (task.getDeploy().getCommand().isPresent()) { commandBldr.setValue(task.getDeploy().getCommand().get()); } if (task.getDeploy().getArguments().isPresent()) { commandBldr.addAllArguments(task.getDeploy().getArguments().get()); } if (task.getPendingTask().getCmdLineArgsList().isPresent()) { commandBldr.addAllArguments(task.getPendingTask().getCmdLineArgsList().get()); } if (task.getDeploy().getShell().isPresent()){ commandBldr.setShell(task.getDeploy().getShell().get()); } else if ((task.getDeploy().getArguments().isPresent() && !task.getDeploy().getArguments().get().isEmpty()) || task.getDeploy().getContainerInfo().isPresent() || (task.getPendingTask().getCmdLineArgsList().isPresent() && !task.getPendingTask().getCmdLineArgsList().get().isEmpty())) { commandBldr.setShell(false); } List<SingularityMesosArtifact> combinedArtifacts = new ArrayList<>(); combinedArtifacts.addAll(task.getDeploy().getUris().or(Collections.emptyList())); combinedArtifacts.addAll(task.getPendingTask().getExtraArtifacts()); prepareMesosUriDownloads(combinedArtifacts, commandBldr); prepareEnvironment(task, taskId, commandBldr, offerHolder, ports); bldr.setCommand(commandBldr); }