diff --git a/.mvn/modernizer/violations.xml b/.mvn/modernizer/violations.xml
index 70edd8642b06..cbb8b4926b57 100644
--- a/.mvn/modernizer/violations.xml
+++ b/.mvn/modernizer/violations.xml
@@ -54,6 +54,52 @@
Use buildOrThrow() instead, as it makes it clear that it will throw on duplicated values
+
+ com/google/common/collect/ImmutableBiMap$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
+ com/google/common/collect/ImmutableList$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
+ com/google/common/collect/ImmutableMap$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
+ com/google/common/collect/ImmutableMultimap$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
+ com/google/common/collect/ImmutableMultiset$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
+ com/google/common/collect/ImmutableSet$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
+ com/google/common/collect/ImmutableSortedMap$Builder."<init>":()V
+ 1.8
+ Use orderedBy() static factory method instead
+
+
+ com/google/common/collect/ImmutableSortedSet$Builder."<init>":()V
+ 1.8
+ Use orderedBy() static factory method instead
+
+
+ com/google/common/collect/ImmutableTable$Builder."<init>":()V
+ 1.8
+ Use builder() static factory method instead
+
+
com/google/common/cache/CacheBuilder.build:()Lcom/google/common/cache/Cache;
1.8
diff --git a/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java b/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java
index 6cfb34f9adfc..d2a03bb7bcd9 100644
--- a/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java
+++ b/core/trino-main/src/main/java/io/trino/execution/ClusterSizeMonitor.java
@@ -142,7 +142,7 @@ private synchronized void updateAllNodes(AllNodes allNodes)
currentCount = Sets.difference(allNodes.getActiveNodes(), allNodes.getActiveCoordinators()).size();
}
- ImmutableList.Builder> listenersBuilder = new ImmutableList.Builder<>();
+ ImmutableList.Builder> listenersBuilder = ImmutableList.builder();
while (!futuresQueue.isEmpty()) {
MinNodesFuture minNodesFuture = futuresQueue.peek();
if (minNodesFuture == null || minNodesFuture.getExecutionMinCount() > currentCount) {
diff --git a/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java b/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java
index 731cab4047dc..4e552af01d43 100644
--- a/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java
+++ b/core/trino-main/src/main/java/io/trino/operator/DynamicFilterSourceOperator.java
@@ -361,7 +361,7 @@ public void finish()
return;
}
finished = true;
- ImmutableMap.Builder domainsBuilder = new ImmutableMap.Builder<>();
+ ImmutableMap.Builder domainsBuilder = ImmutableMap.builder();
if (valueSets == null) {
if (minValues == null) {
// there were too many rows to collect min/max range
diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java
index c724748e1c82..7e1b06098906 100644
--- a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java
+++ b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRankBuilder.java
@@ -148,7 +148,7 @@ private class ResultIterator
ResultIterator()
{
- ImmutableList.Builder sourceTypesBuilders = new ImmutableList.Builder().addAll(sourceTypes);
+ ImmutableList.Builder sourceTypesBuilders = ImmutableList.builder().addAll(sourceTypes);
if (produceRanking) {
sourceTypesBuilders.add(BIGINT);
}
diff --git a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java
index 159bd00ab587..019208427ffe 100644
--- a/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java
+++ b/core/trino-main/src/main/java/io/trino/operator/GroupedTopNRowNumberBuilder.java
@@ -128,7 +128,7 @@ private class ResultIterator
ResultIterator()
{
- ImmutableList.Builder sourceTypesBuilders = new ImmutableList.Builder().addAll(sourceTypes);
+ ImmutableList.Builder sourceTypesBuilders = ImmutableList.builder().addAll(sourceTypes);
if (produceRowNumber) {
sourceTypesBuilders.add(BIGINT);
}
diff --git a/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java b/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java
index a51564404dec..e94f00d1d3d2 100644
--- a/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java
+++ b/core/trino-main/src/main/java/io/trino/operator/aggregation/ApproximateMostFrequentHistogram.java
@@ -145,7 +145,7 @@ public void forEachBucket(BucketConsumer consumer)
@VisibleForTesting
public Map getBuckets()
{
- ImmutableMap.Builder buckets = new ImmutableMap.Builder<>();
+ ImmutableMap.Builder buckets = ImmutableMap.builder();
forEachBucket(buckets::put);
return buckets.buildOrThrow();
diff --git a/core/trino-main/src/main/java/io/trino/server/QueryResource.java b/core/trino-main/src/main/java/io/trino/server/QueryResource.java
index b11930fe9d2e..77073dda812f 100644
--- a/core/trino-main/src/main/java/io/trino/server/QueryResource.java
+++ b/core/trino-main/src/main/java/io/trino/server/QueryResource.java
@@ -79,7 +79,7 @@ public List getAllQueryInfo(@QueryParam("state") String stateFil
List queries = dispatchManager.getQueries();
queries = filterQueries(sessionContextFactory.extractAuthorizedIdentity(servletRequest, httpHeaders, alternateHeaderName), queries, accessControl);
- ImmutableList.Builder builder = new ImmutableList.Builder<>();
+ ImmutableList.Builder builder = ImmutableList.builder();
for (BasicQueryInfo queryInfo : queries) {
if (stateFilter == null || queryInfo.getState() == expectedState) {
builder.add(queryInfo);
diff --git a/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java b/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java
index 7737bb1f9c70..b0cb7eed37a6 100644
--- a/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java
+++ b/core/trino-main/src/main/java/io/trino/server/ui/UiQueryResource.java
@@ -78,7 +78,7 @@ public List getAllQueryInfo(@QueryParam("state") String s
List queries = dispatchManager.getQueries();
queries = filterQueries(sessionContextFactory.extractAuthorizedIdentity(servletRequest, httpHeaders, alternateHeaderName), queries, accessControl);
- ImmutableList.Builder builder = new ImmutableList.Builder<>();
+ ImmutableList.Builder builder = ImmutableList.builder();
for (BasicQueryInfo queryInfo : queries) {
if (stateFilter == null || queryInfo.getState() == expectedState) {
builder.add(new TrimmedBasicQueryInfo(queryInfo));
diff --git a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java
index 3540a8c57991..9dd6453bb1ce 100644
--- a/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java
+++ b/core/trino-main/src/main/java/io/trino/sql/planner/iterative/rule/PushAggregationIntoTableScan.java
@@ -162,10 +162,10 @@ public static Optional pushAggregationIntoTableScan(
AggregationApplicationResult result = aggregationPushdownResult.get();
// The new scan outputs should be the symbols associated with grouping columns plus the symbols associated with aggregations.
- ImmutableList.Builder newScanOutputs = new ImmutableList.Builder<>();
+ ImmutableList.Builder newScanOutputs = ImmutableList.builder();
newScanOutputs.addAll(tableScan.getOutputSymbols());
- ImmutableBiMap.Builder newScanAssignments = new ImmutableBiMap.Builder<>();
+ ImmutableBiMap.Builder newScanAssignments = ImmutableBiMap.builder();
newScanAssignments.putAll(tableScan.getAssignments());
Map variableMappings = new HashMap<>();
@@ -221,7 +221,7 @@ private static AggregateFunction toAggregateFunction(Metadata metadata, Context
String canonicalName = metadata.getFunctionMetadata(aggregation.getResolvedFunction()).getCanonicalName();
BoundSignature signature = aggregation.getResolvedFunction().getSignature();
- ImmutableList.Builder arguments = new ImmutableList.Builder<>();
+ ImmutableList.Builder arguments = ImmutableList.builder();
for (int i = 0; i < aggregation.getArguments().size(); i++) {
SymbolReference argument = (SymbolReference) aggregation.getArguments().get(i);
arguments.add(new Variable(argument.getName(), signature.getArgumentTypes().get(i)));
diff --git a/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java b/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java
index 9ec33598898e..4692b7db9ae4 100644
--- a/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/event/TestQueryMonitorConfig.java
@@ -36,7 +36,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("event.max-output-stage-size", "512kB")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java b/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java
index 233c17b3b3e3..8a02fb5cf876 100644
--- a/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/eventlistener/TestEventListenerConfig.java
@@ -42,7 +42,7 @@ public void testExplicitPropertyMappings()
Path config1 = Files.createTempFile(null, null);
Path config2 = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("event-listener.config-files", config1.toString() + "," + config2.toString())
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java
index 4e0853de46f1..8c82465ab67d 100644
--- a/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/TestDynamicFilterConfig.java
@@ -51,7 +51,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("enable-dynamic-filtering", "false")
.put("enable-coordinator-dynamic-filters-distribution", "false")
.put("enable-large-dynamic-filters", "true")
diff --git a/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java
index c05514af3942..434ccbaf950b 100644
--- a/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/TestFailureInjectionConfig.java
@@ -37,7 +37,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("failure-injection.request-timeout", "12m")
.put("failure-injection.expiration-period", "7m")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java
index 3fb8b50b6ef9..d2699e30e0bb 100644
--- a/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/TestNodeSchedulerConfig.java
@@ -44,7 +44,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("node-scheduler.policy", "topology")
.put("node-scheduler.min-candidates", "11")
.put("node-scheduler.include-coordinator", "false")
diff --git a/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java
index 3250afadddcc..f084b327794c 100644
--- a/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java
@@ -76,7 +76,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("query.client.timeout", "10s")
.put("query.min-expire-age", "30s")
.put("query.max-history", "10")
diff --git a/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java
index 2061d6d7600b..07e0de14fdf2 100644
--- a/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/TestTaskManagerConfig.java
@@ -72,7 +72,7 @@ public void testDefaults()
public void testExplicitPropertyMappings()
{
int processorCount = DEFAULT_PROCESSOR_COUNT == 32 ? 16 : 32;
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("task.initial-splits-per-node", "1")
.put("task.split-concurrency-adjustment-interval", "1s")
.put("task.status-refresh-max-wait", "2s")
diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java
index 86e532271d5a..5935c9bec376 100644
--- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestSubnetTopologyConfig.java
@@ -37,7 +37,7 @@ public void testDefaults()
public void testExplicitPropertyMappings()
throws IOException
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("node-scheduler.network-topology.subnet.cidr-prefix-lengths", "24,26")
.put("node-scheduler.network-topology.subnet.ip-address-protocol", "IPv6")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java
index dfcd0d224fc8..2e719236fe91 100644
--- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyAwareNodeSelectorConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("node-scheduler.network-topology.type", "FILE")
.put("node-scheduler.network-topology.segments", "rack,machine")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java
index 5a561eb8647f..56eb3b9e3ddc 100644
--- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java
+++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestTopologyFileConfig.java
@@ -41,7 +41,7 @@ public void testExplicitPropertyMappings()
{
Path networkTopologyFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("node-scheduler.network-topology.file", networkTopologyFile.toString())
.put("node-scheduler.network-topology.refresh-period", "27m")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java b/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java
index 393eae7d042b..11ddc9122ae8 100644
--- a/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/memory/TestMemoryManagerConfig.java
@@ -44,7 +44,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("query.low-memory-killer.policy", "none")
.put("query.low-memory-killer.delay", "20s")
.put("query.max-memory", "2GB")
diff --git a/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java b/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java
index f02280c69f77..87499c756ee6 100644
--- a/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java
+++ b/core/trino-main/src/test/java/io/trino/memory/TestNodeMemoryConfig.java
@@ -40,7 +40,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("query.max-memory-per-node", "1GB")
.put("query.max-memory-per-task", "200MB")
.put("memory.heap-headroom-per-node", "1GB")
diff --git a/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java b/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java
index e91d4d94fd87..b0cd1410f518 100644
--- a/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java
+++ b/core/trino-main/src/test/java/io/trino/metadata/TestInformationSchemaMetadata.java
@@ -93,7 +93,7 @@ public void testInformationSchemaPredicatePushdown()
{
TransactionId transactionId = transactionManager.beginTransaction(false);
- ImmutableMap.Builder domains = new ImmutableMap.Builder<>();
+ ImmutableMap.Builder domains = ImmutableMap.builder();
domains.put(new InformationSchemaColumnHandle("table_schema"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_schema")));
domains.put(new InformationSchemaColumnHandle("table_name"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_view")));
Constraint constraint = new Constraint(TupleDomain.withColumnDomains(domains.buildOrThrow()));
@@ -133,7 +133,7 @@ public void testInformationSchemaPredicatePushdownWithoutSchemaPredicate()
TransactionId transactionId = transactionManager.beginTransaction(false);
// predicate without schema predicates should cause schemas to be enumerated when table predicates are present
- ImmutableMap.Builder domains = new ImmutableMap.Builder<>();
+ ImmutableMap.Builder domains = ImmutableMap.builder();
domains.put(new InformationSchemaColumnHandle("table_name"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_view")));
Constraint constraint = new Constraint(TupleDomain.withColumnDomains(domains.buildOrThrow()));
@@ -157,7 +157,7 @@ public void testInformationSchemaPredicatePushdownWithoutTablePredicate()
TransactionId transactionId = transactionManager.beginTransaction(false);
// predicate without table name predicates should not cause table level prefixes to be evaluated
- ImmutableMap.Builder domains = new ImmutableMap.Builder<>();
+ ImmutableMap.Builder domains = ImmutableMap.builder();
domains.put(new InformationSchemaColumnHandle("table_schema"), Domain.singleValue(VARCHAR, Slices.utf8Slice("test_schema")));
Constraint constraint = new Constraint(TupleDomain.withColumnDomains(domains.buildOrThrow()));
diff --git a/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java b/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java
index c21106edf842..d00d87b59c20 100644
--- a/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java
+++ b/core/trino-main/src/test/java/io/trino/metadata/TestStaticCatalogStoreConfig.java
@@ -37,7 +37,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("catalog.config-dir", "/foo")
.put("catalog.disabled-catalogs", "abc,xyz")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java b/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java
index cc7dc9c73f38..12630b8b225d 100644
--- a/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java
+++ b/core/trino-main/src/test/java/io/trino/operator/TestDirectExchangeClientConfig.java
@@ -47,7 +47,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("exchange.max-buffer-size", "1GB")
.put("exchange.concurrent-request-multiplier", "13")
.put("exchange.min-error-duration", "13s")
diff --git a/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java b/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java
index ae2dd00173c5..7a9e7c860da8 100644
--- a/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java
+++ b/core/trino-main/src/test/java/io/trino/operator/aggregation/TestArrayMaxNAggregation.java
@@ -104,7 +104,7 @@ private void testCustomAggregation(Long[] values, int n)
{
PriorityQueue heap = new PriorityQueue<>(n);
Arrays.stream(values).filter(Objects::nonNull).forEach(heap::add);
- ImmutableList.Builder> expected = new ImmutableList.Builder<>();
+ ImmutableList.Builder> expected = ImmutableList.builder();
for (int i = heap.size() - 1; i >= 0; i--) {
expected.add(ImmutableList.of(heap.remove()));
}
diff --git a/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java b/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java
index 7cb0555058cd..4874d0e6063f 100644
--- a/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java
+++ b/core/trino-main/src/test/java/io/trino/operator/aggregation/minmaxby/TestMinMaxByAggregation.java
@@ -75,7 +75,7 @@ public void testAllRegistered()
private static List getTypes()
{
- return new ImmutableList.Builder()
+ return ImmutableList.builder()
.addAll(STANDARD_TYPES)
.add(VARCHAR)
.add(createDecimalType(1))
diff --git a/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java b/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java
index d6f8b366b1bc..8303981b12d7 100644
--- a/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java
+++ b/core/trino-main/src/test/java/io/trino/security/TestAccessControlConfig.java
@@ -39,7 +39,7 @@ public void testExplicitPropertyMappings()
Path config1 = Files.createTempFile(null, null);
Path config2 = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("access-control.config-files", config1.toString() + "," + config2.toString())
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java b/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java
index 7ad7b2e39709..4ed0dc15bda9 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestEmbeddedDiscoveryConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("discovery-server.enabled", "false")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java b/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java
index cb11eaabd45b..a3210a76490d 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestFailureDetectorConfig.java
@@ -41,7 +41,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("failure-detector.expiration-grace-interval", "5m")
.put("failure-detector.warmup-interval", "60s")
.put("failure-detector.heartbeat-interval", "10s")
diff --git a/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java b/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java
index d9c529cd6eff..d05bdf6c1658 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestInternalCommunicationConfig.java
@@ -48,7 +48,7 @@ public void testExplicitPropertyMappings()
Path keystoreFile = Files.createTempFile(null, null);
Path truststoreFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("internal-communication.shared-secret", "secret")
.put("internal-communication.http2.enabled", "true")
.put("internal-communication.https.required", "true")
diff --git a/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java b/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java
index 751ec4f9fc32..35311540f937 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestJmxNamingConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("jmx.base-name", "my.stuff")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java b/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java
index c99ef4dcc7e6..1679cae97cfe 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestProtocolConfig.java
@@ -36,7 +36,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("protocol.v1.alternate-header-name", "taco")
.put("protocol.v1.prepared-statement-compression.length-threshold", "412")
.put("protocol.v1.prepared-statement-compression.min-gain", "0")
diff --git a/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java b/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java
index fd0e6862e678..645b7acadd3d 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestServerConfig.java
@@ -41,7 +41,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("coordinator", "false")
.put("experimental.concurrent-startup", "true")
.put("http.include-exception-in-response", "false")
diff --git a/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java b/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java
index 71138a35d9cd..75a706f8fd06 100644
--- a/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/TestServerPluginsProviderConfig.java
@@ -35,7 +35,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("plugin.dir", "plugins-dir")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java
index 11cea1640eb8..1face4ec07e0 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/TestCertificateConfig.java
@@ -41,7 +41,7 @@ public void testExplicitPropertyMappings()
{
Path userMappingFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.certificate.user-mapping.pattern", "(.*)@something")
.put("http-server.authentication.certificate.user-mapping.file", userMappingFile.toString())
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java
index 44f41646f87c..375864b1c009 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/TestHeaderAuthenticatorConfig.java
@@ -45,7 +45,7 @@ public void testExplicitPropertyMappings()
Path config1 = Files.createTempFile(null, null);
Path config2 = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.header.user-mapping.pattern", "(.*)@something")
.put("http-server.authentication.header.user-mapping.file", userMappingFile.toString())
.put("header-authenticator.config-files", config1.toString() + "," + config2.toString())
diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java
index a41cb3ef4edb..0e081d2f5946 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/TestInsecureAuthenticatorConfig.java
@@ -41,7 +41,7 @@ public void testExplicitPropertyMappings()
{
Path userMappingFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.insecure.user-mapping.pattern", "(.*)@something")
.put("http-server.authentication.insecure.user-mapping.file", userMappingFile.toString())
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java
index 4fda0beb3247..15200b47a8f7 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/TestKerberosConfig.java
@@ -50,7 +50,7 @@ public void testExplicitPropertyMappings()
Path keytabFile = Files.createTempFile(null, null);
Path userMappingFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http.authentication.krb5.config", krbConfigFile.toString())
.put("http-server.authentication.krb5.service-name", "airlift")
.put("http-server.authentication.krb5.keytab", keytabFile.toString())
diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java
index f3feb0f17352..0ecf79e06f9a 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/TestPasswordAuthenticatorConfig.java
@@ -44,7 +44,7 @@ public void testExplicitPropertyMappings()
Path config1 = Files.createTempFile(null, null);
Path config2 = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.password.user-mapping.pattern", "(.*)@something")
.put("http-server.authentication.password.user-mapping.file", userMappingFile.toString())
.put("password-authenticator.config-files", config1.toString() + "," + config2.toString())
diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java b/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java
index 181a956d7984..5b7b32966197 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/TestSecurityConfig.java
@@ -38,7 +38,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.type", "KERBEROS,PASSWORD")
.put("http-server.authentication.allow-insecure-over-http", "false")
.put("management.user", "management-user")
diff --git a/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java b/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java
index e58e288e1976..a83d74d76442 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/jwt/TestJwtAuthenticatorConfig.java
@@ -46,7 +46,7 @@ public void testExplicitPropertyMappings()
Path jwtKeyFile = Files.createTempFile(null, null);
Path userMappingFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.jwt.key-file", jwtKeyFile.toString())
.put("http-server.authentication.jwt.required-audience", "some-audience")
.put("http-server.authentication.jwt.required-issuer", "some-issuer")
diff --git a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java
index e7b480df2d95..29b0b75a0a6e 100644
--- a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java
+++ b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOAuth2Config.java
@@ -59,7 +59,7 @@ public void testExplicitPropertyMappings()
throws IOException
{
Path userMappingFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("http-server.authentication.oauth2.state-key", "key-secret")
.put("http-server.authentication.oauth2.issuer", "http://127.0.0.1:9000/oauth2")
.put("http-server.authentication.oauth2.access-token-issuer", "http://127.0.0.1:9000/oauth2/access-token")
diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java b/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java
index a4a7bc605dac..8b762bccda70 100644
--- a/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/ui/TestFixedUserWebUiConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("web-ui.user", "some-user")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java b/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java
index ecc9a8e4d9fb..e83844ab4e80 100644
--- a/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/ui/TestFormWebUiConfig.java
@@ -37,7 +37,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("web-ui.session-timeout", "33s")
.put("web-ui.shared-secret", "test-secret")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java
index 4d60b2c4d35b..1231b7d9b18d 100644
--- a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java
+++ b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUiConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("web-ui.enabled", "false")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java b/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java
index bc7b921cd761..bf953b29cd78 100644
--- a/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java
+++ b/core/trino-main/src/test/java/io/trino/spiller/TestNodeSpillConfig.java
@@ -40,7 +40,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("max-spill-per-node", "10MB")
.put("query-max-spill-per-node", "15 MB")
.put("spill-compression-enabled", "true")
diff --git a/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java b/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java
index 6f6f9e3cac9d..b423c9c052f2 100644
--- a/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java
+++ b/core/trino-main/src/test/java/io/trino/sql/TestSqlEnvironmentConfig.java
@@ -39,7 +39,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("sql.path", "a.b, c.d")
.put("sql.default-catalog", "some-catalog")
.put("sql.default-schema", "some-schema")
diff --git a/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java b/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java
index 3d5c6e38a49b..5eedcd802045 100644
--- a/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java
+++ b/core/trino-main/src/test/java/io/trino/sql/analyzer/TestFeaturesConfig.java
@@ -120,7 +120,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("cpu-cost-weight", "0.4")
.put("memory-cost-weight", "0.3")
.put("network-cost-weight", "0.2")
diff --git a/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java b/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java
index b7b227c6442e..d2fa9f6e256b 100644
--- a/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/sql/planner/TestCompilerConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("compiler.expression-cache-size", "52")
.buildOrThrow();
diff --git a/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java b/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java
index e0836a5885b0..db11f432414a 100644
--- a/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java
+++ b/core/trino-main/src/test/java/io/trino/transaction/TestTransactionManagerConfig.java
@@ -38,7 +38,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("transaction.idle-check-interval", "1s")
.put("transaction.idle-timeout", "10s")
.put("transaction.max-finishing-concurrency", "100")
diff --git a/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java b/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java
index 46fd6b0215b3..600c3e597fed 100644
--- a/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java
+++ b/lib/trino-orc/src/main/java/io/trino/orc/metadata/OrcMetadataReader.java
@@ -585,7 +585,7 @@ private static OrcTypeKind toTypeKind(OrcProto.Type.Kind typeKind)
// This method assumes type attributes have no duplicate key
private static Map toMap(List attributes)
{
- ImmutableMap.Builder results = new ImmutableMap.Builder<>();
+ ImmutableMap.Builder results = ImmutableMap.builder();
if (attributes != null) {
for (OrcProto.StringPair attribute : attributes) {
if (attribute.hasKey() && attribute.hasValue()) {
diff --git a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java
index a3a1a6f36555..56432398ed23 100644
--- a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java
+++ b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/security/TestFileBasedAccessControlConfig.java
@@ -48,7 +48,7 @@ public void testExplicitPropertyMappings()
{
Path securityConfigFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put(SECURITY_CONFIG_FILE, securityConfigFile.toString())
.put(SECURITY_REFRESH_PERIOD, "1s")
.buildOrThrow();
diff --git a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java
index 74fb29182b7a..faf2b72cf67c 100644
--- a/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java
+++ b/plugin/trino-atop/src/test/java/io/trino/plugin/atop/TestAtopConnectorConfig.java
@@ -49,7 +49,7 @@ public void testExplicitPropertyMappings()
{
Path atopExecutable = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("atop.executable-path", atopExecutable.toString())
.put("atop.concurrent-readers-per-node", "10")
.put("atop.executable-read-timeout", "1m")
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java
index 309c43849af5..c78ca674cc0d 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestBaseJdbcConfig.java
@@ -47,7 +47,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("connection-url", "jdbc:h2:mem:config")
.put("jdbc-types-mapped-to-varchar", "mytype,struct_type1")
.put("metadata.cache-ttl", "1s")
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java
index 6576b182be05..5c7730d9db59 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestCredentialProviderTypeConfig.java
@@ -37,7 +37,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("credential-provider.type", "FILE")
.buildOrThrow();
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java
index 89032b7f5f2c..03bafa36bc5d 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestDecimalConfig.java
@@ -40,7 +40,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("decimal-mapping", "allow_overflow")
.put("decimal-default-scale", "16")
.put("decimal-rounding-mode", "HALF_UP")
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java
index 88e980eaf9e3..f84e8026f9a0 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcMetadataConfig.java
@@ -37,7 +37,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("join-pushdown.enabled", "true")
.put("aggregation-pushdown.enabled", "false")
.put("domain-compaction-threshold", "42")
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java
index 1eb9b7e2df35..b0e84043e49e 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestJdbcWriteConfig.java
@@ -38,7 +38,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("write.batch-size", "24")
.put("insert.non-transactional-insert.enabled", "true")
.buildOrThrow();
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java
index 4cad37e13d62..769958a0c5f9 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestRemoteQueryCancellationConfig.java
@@ -34,7 +34,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("remote-query-async-cancellation.enabled", "false")
.buildOrThrow();
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java
index 2b3d1d890c97..4369f3a3cad8 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/TestTypeHandlingJdbcConfig.java
@@ -35,7 +35,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("unsupported-type-handling", "CONVERT_TO_VARCHAR")
.buildOrThrow();
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java
index bedef3519d10..dfd37396809c 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestCredentialProvider.java
@@ -57,7 +57,7 @@ public void testFileCredentialProvider()
@Test
public void testKeyStoreBasedCredentialProvider()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("connection-url", "jdbc:h2:mem:config")
.put("credential-provider.type", "KEYSTORE")
.put("keystore-file-path", getResourceFilePath("credentials.jceks"))
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java
index 08059ae8b916..cb7cc513e775 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/TestExtraCredentialConfig.java
@@ -35,7 +35,7 @@ public void testDefaults()
@Test
public void testExplicitPropertyMappings()
{
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("user-credential-name", "foo")
.put("password-credential-name", "bar")
.buildOrThrow();
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java
index 2d2c88c4a4a1..c55ed12b9337 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/file/TestConfigFileBasedCredentialProviderConfig.java
@@ -40,7 +40,7 @@ public void testExplicitPropertyMappings()
{
Path credentialFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("connection-credential-file", credentialFile.toString())
.buildOrThrow();
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java
index 28cb030d3ca4..9aaf10555268 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/credential/keystore/TestKeyStoreBasedCredentialProviderConfig.java
@@ -46,7 +46,7 @@ public void testExplicitPropertyMappings()
{
Path keystoreFile = Files.createTempFile(null, null);
- Map properties = new ImmutableMap.Builder()
+ Map properties = ImmutableMap.builder()
.put("keystore-file-path", keystoreFile.toString())
.put("keystore-type", "JCEKS")
.put("keystore-password", "keystore_password")
diff --git a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java
index 6c6f614cecaf..b2917520fb7e 100644
--- a/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java
+++ b/plugin/trino-base-jdbc/src/test/java/io/trino/plugin/jdbc/mapping/TestMappingConfig.java
@@ -43,7 +43,7 @@ public void testExplicitPropertyMappings()
throws Exception
{
String configFile = createRuleBasedIdentifierMappingFile().toFile().getAbsolutePath();
- Map