Makes PathFragment have internal CODEC definition.

PiperOrigin-RevId: 179588512
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java b/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
index bce569f..4195485 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
@@ -13,6 +13,7 @@
 // limitations under the License.
 package com.google.devtools.build.lib.vfs;
 
+import static com.google.common.collect.ImmutableList.toImmutableList;
 import static com.google.common.truth.Truth.assertThat;
 import static org.junit.Assert.fail;
 
@@ -20,6 +21,7 @@
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.testing.EqualsTester;
+import com.google.devtools.build.lib.skyframe.serialization.testutils.ObjectCodecTester;
 import com.google.devtools.build.lib.testutil.TestUtils;
 import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
 import java.io.File;
@@ -550,6 +552,17 @@
   }
 
   @Test
+  public void testCodec() throws Exception {
+    ObjectCodecTester.newBuilder(PathFragment.CODEC)
+        .addSubjects(
+            ImmutableList.of("", "a", "/foo", "foo/bar/baz", "/a/path/fragment/with/lots/of/parts")
+                .stream()
+                .map(PathFragment::create)
+                .collect(toImmutableList()))
+        .buildAndRunTests();
+  }
+
+  @Test
   public void testSerializationSimple() throws Exception {
    checkSerialization("a", 91);
   }