diff --git a/server/src/test/java/org/opensearch/common/cache/stats/MultiDimensionCacheStatsTests.java b/server/src/test/java/org/opensearch/common/cache/stats/MultiDimensionCacheStatsTests.java index b579e07d81f31..4aac50b9f4b59 100644 --- a/server/src/test/java/org/opensearch/common/cache/stats/MultiDimensionCacheStatsTests.java +++ b/server/src/test/java/org/opensearch/common/cache/stats/MultiDimensionCacheStatsTests.java @@ -17,11 +17,9 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Random; -import java.util.Set; import java.util.UUID; public class MultiDimensionCacheStatsTests extends OpenSearchTestCase { @@ -149,7 +147,11 @@ private Map, MultiDimensionCacheStats.DimensionNode> getAllLeafNode return result; } - private void getAllLeafNodesHelper(Map, MultiDimensionCacheStats.DimensionNode> result, MultiDimensionCacheStats.DimensionNode current, List pathToCurrent) { + private void getAllLeafNodesHelper( + Map, MultiDimensionCacheStats.DimensionNode> result, + MultiDimensionCacheStats.DimensionNode current, + List pathToCurrent + ) { if (current.children.isEmpty()) { result.put(pathToCurrent, current); } else { diff --git a/server/src/test/java/org/opensearch/common/cache/stats/StatsHolderTests.java b/server/src/test/java/org/opensearch/common/cache/stats/StatsHolderTests.java index e92c1b9f1a484..24542124b92bb 100644 --- a/server/src/test/java/org/opensearch/common/cache/stats/StatsHolderTests.java +++ b/server/src/test/java/org/opensearch/common/cache/stats/StatsHolderTests.java @@ -16,7 +16,6 @@ import java.util.List; import java.util.Map; import java.util.Random; -import java.util.Set; import static org.opensearch.common.cache.stats.MultiDimensionCacheStatsTests.getUsedDimensionValues; import static org.opensearch.common.cache.stats.MultiDimensionCacheStatsTests.populateStats; @@ -77,16 +76,12 @@ public void testKeyContainsAllDimensions() throws Exception { List dims = List.of(new CacheStatsDimension("dim1", "A"), new CacheStatsDimension("dim2", "B")); - StatsHolder.Key matchingKey = new StatsHolder.Key(List.of( - new CacheStatsDimension("dim1", "A"), - new CacheStatsDimension("dim2", "B"), - new CacheStatsDimension("dim3", "C") - )); - StatsHolder.Key nonMatchingKey = new StatsHolder.Key(List.of( - new CacheStatsDimension("dim1", "A"), - new CacheStatsDimension("dim2", "Z"), - new CacheStatsDimension("dim3", "C") - )); + StatsHolder.Key matchingKey = new StatsHolder.Key( + List.of(new CacheStatsDimension("dim1", "A"), new CacheStatsDimension("dim2", "B"), new CacheStatsDimension("dim3", "C")) + ); + StatsHolder.Key nonMatchingKey = new StatsHolder.Key( + List.of(new CacheStatsDimension("dim1", "A"), new CacheStatsDimension("dim2", "Z"), new CacheStatsDimension("dim3", "C")) + ); assertTrue(statsHolder.keyContainsAllDimensions(matchingKey, dims)); assertFalse(statsHolder.keyContainsAllDimensions(nonMatchingKey, dims));