diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java index 5f06baa0ff..bd48b463bd 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/stub/metrics/BuiltinMetricsTracerTest.java @@ -221,19 +221,13 @@ public void sendMessage(ReqT message) { final ApiFunction oldConfigurator = channelProvider.getChannelConfigurator(); - @SuppressWarnings("rawtypes") - final ApiFunction newConfigurator = - new ApiFunction() { - @Override - @SuppressWarnings("rawtypes") - public ManagedChannelBuilder apply(ManagedChannelBuilder builder) { - if (oldConfigurator != null) { - builder = oldConfigurator.apply(builder); - } - return builder.intercept(clientInterceptor); + channelProvider.setChannelConfigurator( + (builder) -> { + if (oldConfigurator != null) { + builder = oldConfigurator.apply(builder); } - }; - channelProvider.setChannelConfigurator(newConfigurator); + return builder.intercept(clientInterceptor); + }); stubSettingsBuilder.setTransportChannelProvider(channelProvider.build()); EnhancedBigtableStubSettings stubSettings = stubSettingsBuilder.build();