The startPipeline() method starts a Process for each ProcessBuilder object in the list. Except for the first and the last processes, it redirects the output of one process to the input of another process by using ProcessBuilder.Redirect.PIPE. If you have provided redirectOutput for any intermediate process as something other than ProcessBuilder.Redirect.PIPE, then there will be an error thrown, something similar to the following:
Exception in thread "main" java.lang.IllegalArgumentException: builder redirectOutput() must be PIPE except for the last builder: INHERIT.
It states that any builder except for the last should redirect its output to the next process. The same is applicable for redirectInput.