Make ProcessWrapperUtil aware of the execution statistics file, and add new ExecutionStatisticsProvider.

RELNOTES: None.
PiperOrigin-RevId: 178056182
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/ProcessWrapperUtilTest.java b/src/test/java/com/google/devtools/build/lib/runtime/ProcessWrapperUtilTest.java
index 91735e3..6d182f2 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/ProcessWrapperUtilTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/ProcessWrapperUtilTest.java
@@ -17,8 +17,8 @@
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.devtools.build.lib.testutil.MoreAsserts.expectThrows;
 
+import com.google.common.collect.ImmutableList;
 import java.time.Duration;
-import java.util.ArrayList;
 import java.util.List;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -30,9 +30,7 @@
 
   @Test
   public void testProcessWrapperCommandLineBuilder_ProcessWrapperPathIsRequired() {
-    List<String> commandArguments = new ArrayList<>();
-    commandArguments.add("echo");
-    commandArguments.add("hello, world");
+    ImmutableList<String> commandArguments = ImmutableList.of("echo", "hello, world");
 
     Exception e =
         expectThrows(
@@ -62,13 +60,10 @@
   public void testProcessWrapperCommandLineBuilder_BuildsWithoutOptionalArguments() {
     String processWrapperPath = "process-wrapper";
 
-    List<String> commandArguments = new ArrayList<>();
-    commandArguments.add("echo");
-    commandArguments.add("hello, world");
+    ImmutableList<String> commandArguments = ImmutableList.of("echo", "hello, world");
 
-    List<String> expectedCommandLine = new ArrayList<>();
-    expectedCommandLine.add(processWrapperPath);
-    expectedCommandLine.addAll(commandArguments);
+    ImmutableList<String> expectedCommandLine =
+        ImmutableList.<String>builder().add(processWrapperPath).addAll(commandArguments).build();
 
     List<String> commandLine =
         ProcessWrapperUtil.commandLineBuilder()
@@ -83,22 +78,24 @@
   public void testProcessWrapperCommandLineBuilder_BuildsWithOptionalArguments() {
     String processWrapperPath = "process-wrapper";
 
-    List<String> commandArguments = new ArrayList<>();
-    commandArguments.add("echo");
-    commandArguments.add("hello, world");
+    ImmutableList<String> commandArguments = ImmutableList.of("echo", "hello, world");
 
     Duration timeout = Duration.ofSeconds(10);
     Duration killDelay = Duration.ofSeconds(2);
     String stdoutPath = "stdout.txt";
     String stderrPath = "stderr.txt";
+    String statisticsPath = "stats.out";
 
-    List<String> expectedCommandLine = new ArrayList<>();
-    expectedCommandLine.add(processWrapperPath);
-    expectedCommandLine.add("--timeout=" + timeout.getSeconds());
-    expectedCommandLine.add("--kill_delay=" + killDelay.getSeconds());
-    expectedCommandLine.add("--stdout=" + stdoutPath);
-    expectedCommandLine.add("--stderr=" + stderrPath);
-    expectedCommandLine.addAll(commandArguments);
+    ImmutableList<String> expectedCommandLine =
+        ImmutableList.<String>builder()
+            .add(processWrapperPath)
+            .add("--timeout=" + timeout.getSeconds())
+            .add("--kill_delay=" + killDelay.getSeconds())
+            .add("--stdout=" + stdoutPath)
+            .add("--stderr=" + stderrPath)
+            .add("--stats=" + statisticsPath)
+            .addAll(commandArguments)
+            .build();
 
     List<String> commandLine =
         ProcessWrapperUtil.commandLineBuilder()
@@ -108,6 +105,7 @@
             .setKillDelay(killDelay)
             .setStdoutPath(stdoutPath)
             .setStderrPath(stderrPath)
+            .setStatisticsPath(statisticsPath)
             .build();
 
     assertThat(commandLine).containsExactlyElementsIn(expectedCommandLine);