diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java
index 05b2782..a831f34 100644
--- a/service-t/src/com/android/server/ethernet/EthernetTracker.java
+++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java
@@ -459,7 +459,7 @@
         String transport = tokens.length > 3 ? tokens[3] : null;
         NetworkCapabilities nc = createNetworkCapabilities(
                 !TextUtils.isEmpty(capabilities)  /* clear default capabilities */, capabilities,
-                transport);
+                transport).build();
         mNetworkCapabilities.put(name, nc);
 
         if (tokens.length > 2 && !TextUtils.isEmpty(tokens[2])) {
@@ -469,25 +469,26 @@
     }
 
     private static NetworkCapabilities createDefaultNetworkCapabilities(boolean isTestIface) {
-        NetworkCapabilities nc = createNetworkCapabilities(false /* clear default capabilities */);
-        nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED);
-        nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED);
-        nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING);
-        nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED);
-        nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED);
-        nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED);
+        NetworkCapabilities.Builder builder = createNetworkCapabilities(
+                false /* clear default capabilities */, null, null)
+                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)
+                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED)
+                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING)
+                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED)
+                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED)
+                .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED);
 
         if (isTestIface) {
-            nc.addTransportType(NetworkCapabilities.TRANSPORT_TEST);
+                builder.addTransportType(NetworkCapabilities.TRANSPORT_TEST);
         } else {
-            nc.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
+                builder.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET);
         }
 
-        return nc;
+        return builder.build();
     }
 
     private static NetworkCapabilities createNetworkCapabilities(boolean clearDefaultCapabilities) {
-        return createNetworkCapabilities(clearDefaultCapabilities, null, null);
+        return createNetworkCapabilities(clearDefaultCapabilities, null, null).build();
     }
 
     /**
@@ -502,7 +503,7 @@
      *                          will cause the override to be ignored.
      */
     @VisibleForTesting
-    static NetworkCapabilities createNetworkCapabilities(
+    static NetworkCapabilities.Builder createNetworkCapabilities(
             boolean clearDefaultCapabilities, @Nullable String commaSeparatedCapabilities,
             @Nullable String overrideTransport) {
 
@@ -566,7 +567,7 @@
         builder.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED);
         builder.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED);
 
-        return builder.build();
+        return builder;
     }
 
     /**
diff --git a/tests/ethernet/java/com/android/server/ethernet/EthernetTrackerTest.java b/tests/ethernet/java/com/android/server/ethernet/EthernetTrackerTest.java
index 1218788..43571bb 100644
--- a/tests/ethernet/java/com/android/server/ethernet/EthernetTrackerTest.java
+++ b/tests/ethernet/java/com/android/server/ethernet/EthernetTrackerTest.java
@@ -133,11 +133,11 @@
         }
     }
 
-    private NetworkCapabilitiesBuilder makeEthernetCapabilitiesBuilder(boolean clearAll) {
-        final NetworkCapabilitiesBuilder result =
-                clearAll ? new NetworkCapabilitiesBuilder().clearAll()
-                        : new NetworkCapabilitiesBuilder();
-        return result.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING)
+    private NetworkCapabilities.Builder makeEthernetCapabilitiesBuilder(boolean clearAll) {
+        final NetworkCapabilities.Builder builder =
+                clearAll ? new NetworkCapabilities.Builder().clearAll()
+                        : new NetworkCapabilities.Builder();
+        return builder.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING)
                 .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED)
                 .addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED);
     }
@@ -153,14 +153,14 @@
                 makeEthernetCapabilitiesBuilder(true /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(NetworkCapabilities.TRANSPORT_ETHERNET)
+                        .addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET)
                         .build();
 
         NetworkCapabilities ethernetClearedWithCommonCaps =
                 makeEthernetCapabilitiesBuilder(true /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(NetworkCapabilities.TRANSPORT_ETHERNET)
+                        .addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET)
                         .addCapability(12)
                         .addCapability(13)
                         .addCapability(14)
@@ -177,7 +177,7 @@
                 makeEthernetCapabilitiesBuilder(false /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(NetworkCapabilities.TRANSPORT_ETHERNET)
+                        .addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET)
                         .build(),
                 false, "", "");
 
@@ -187,7 +187,7 @@
                 makeEthernetCapabilitiesBuilder(false /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(NetworkCapabilities.TRANSPORT_ETHERNET)
+                        .addTransportType(NetworkCapabilities.TRANSPORT_ETHERNET)
                         .addCapability(11)
                         .addCapability(12)
                         .build(),
@@ -207,28 +207,28 @@
                 makeEthernetCapabilitiesBuilder(true /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(0)
+                        .addTransportType(0)
                         .build(),
                 true, "", "0");
         assertParsedNetworkCapabilities(
                 makeEthernetCapabilitiesBuilder(true /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(1)
+                        .addTransportType(1)
                         .build(),
                 true, "", "1");
         assertParsedNetworkCapabilities(
                 makeEthernetCapabilitiesBuilder(true /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(2)
+                        .addTransportType(2)
                         .build(),
                 true, "", "2");
         assertParsedNetworkCapabilities(
                 makeEthernetCapabilitiesBuilder(true /* clearAll */)
                         .setLinkUpstreamBandwidthKbps(100000)
                         .setLinkDownstreamBandwidthKbps(100000)
-                        .addTransport(3)
+                        .addTransportType(3)
                         .build(),
                 true, "", "3");
 
@@ -256,7 +256,7 @@
                         .addCapability(13)
                         .addCapability(14)
                         .addCapability(15)
-                        .addTransport(3)
+                        .addTransportType(3)
                         .build(),
                 true, "12,13,14,15", "3");
 
@@ -268,42 +268,6 @@
             boolean clearCapabilties, String configCapabiltiies,String configTransports) {
         assertEquals(expectedNetworkCapabilities,
                 EthernetTracker.createNetworkCapabilities(clearCapabilties, configCapabiltiies,
-                        configTransports));
-    }
-
-    private static class NetworkCapabilitiesBuilder {
-        private final NetworkCapabilities nc = new NetworkCapabilities();
-
-        NetworkCapabilitiesBuilder clearAll(){
-            // This is THE ONLY one that doesn't return a reference to the object so I wrapped
-            // everything in a builder to keep things consistent and clean above. Fix if this
-            // ever changes
-            nc.clearAll();
-            return this;
-        }
-
-        NetworkCapabilitiesBuilder addCapability(int capability) {
-            nc.addCapability(capability);
-            return this;
-        }
-
-        NetworkCapabilitiesBuilder addTransport(int transport) {
-            nc.addTransportType(transport);
-            return this;
-        }
-
-        NetworkCapabilitiesBuilder setLinkUpstreamBandwidthKbps(int upKbps) {
-            nc.setLinkUpstreamBandwidthKbps(upKbps);
-            return this;
-        }
-
-        NetworkCapabilitiesBuilder setLinkDownstreamBandwidthKbps(int downKbps) {
-            nc.setLinkDownstreamBandwidthKbps(downKbps);
-            return this;
-        }
-
-        NetworkCapabilities build() {
-            return new NetworkCapabilities(nc);
-        }
+                        configTransports).build());
     }
 }
