diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestParallelSearcher.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestParallelSearcher.java index e18fd9986233c..24a9a6ed694c7 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestParallelSearcher.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestParallelSearcher.java @@ -16,7 +16,6 @@ */ package org.apache.arrow.algorithm.search; -import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.assertEquals; import java.nio.charset.StandardCharsets; @@ -25,6 +24,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.stream.Stream; import org.apache.arrow.algorithm.sort.DefaultVectorComparators; import org.apache.arrow.algorithm.sort.VectorValueComparator; import org.apache.arrow.memory.BufferAllocator; @@ -36,6 +36,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; + /** Test cases for {@link ParallelSearcher}. */ public class TestParallelSearcher { diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestVectorRangeSearcher.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestVectorRangeSearcher.java index 0d4f45caadb99..922ec6cbeeb82 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestVectorRangeSearcher.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/search/TestVectorRangeSearcher.java @@ -19,7 +19,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.stream.Stream; - import org.apache.arrow.algorithm.sort.DefaultVectorComparators; import org.apache.arrow.algorithm.sort.VectorValueComparator; import org.apache.arrow.memory.BufferAllocator; @@ -30,6 +29,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; + /** Test cases for {@link VectorRangeSearcher}. */ public class TestVectorRangeSearcher { @@ -181,11 +181,6 @@ public void testGetUpperBoundsNegative(int repeat) { } public static Stream getRepeat() { - return Stream.of( - Arguments.of(1), - Arguments.of(2), - Arguments.of(5), - Arguments.of(10) - ); + return Stream.of(Arguments.of(1), Arguments.of(2), Arguments.of(5), Arguments.of(10)); } } diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthOutOfPlaceVectorSorter.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthOutOfPlaceVectorSorter.java index ecd39a410275d..e1e5167831235 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthOutOfPlaceVectorSorter.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthOutOfPlaceVectorSorter.java @@ -35,6 +35,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; + /** Test cases for {@link FixedWidthOutOfPlaceVectorSorter}. */ public class TestFixedWidthOutOfPlaceVectorSorter extends TestOutOfPlaceVectorSorter { diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthSorting.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthSorting.java index de0b0d89b35c5..d9056d08f4988 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthSorting.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestFixedWidthSorting.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.function.Function; import java.util.stream.Stream; - import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.BaseFixedWidthVector; @@ -35,6 +34,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; + /** Test sorting fixed width vectors with random data. */ public class TestFixedWidthSorting> { @@ -70,7 +70,10 @@ public void testSort( } } - void sortInPlace(int length, double nullFraction, Function vectorGenerator, + void sortInPlace( + int length, + double nullFraction, + Function vectorGenerator, TestSortingUtil.DataGenerator dataGenerator) { try (V vector = vectorGenerator.apply(allocator)) { U[] array = dataGenerator.populate(vector, length, nullFraction); @@ -86,7 +89,10 @@ void sortInPlace(int length, double nullFraction, Function v } } - void sortOutOfPlace(int length, double nullFraction, Function vectorGenerator, + void sortOutOfPlace( + int length, + double nullFraction, + Function vectorGenerator, TestSortingUtil.DataGenerator dataGenerator) { try (V vector = vectorGenerator.apply(allocator)) { U[] array = dataGenerator.populate(vector, length, nullFraction); @@ -123,8 +129,7 @@ public static Stream getParameters() { "TinyIntVector", (Function) allocator -> new TinyIntVector("vector", allocator), - TestSortingUtil.TINY_INT_GENERATOR - )); + TestSortingUtil.TINY_INT_GENERATOR)); params.add( Arguments.of( @@ -134,8 +139,7 @@ public static Stream getParameters() { "SmallIntVector", (Function) allocator -> new SmallIntVector("vector", allocator), - TestSortingUtil.SMALL_INT_GENERATOR - )); + TestSortingUtil.SMALL_INT_GENERATOR)); params.add( Arguments.of( @@ -145,8 +149,7 @@ public static Stream getParameters() { "IntVector", (Function) allocator -> new IntVector("vector", allocator), - TestSortingUtil.INT_GENERATOR - )); + TestSortingUtil.INT_GENERATOR)); params.add( Arguments.of( @@ -156,8 +159,7 @@ public static Stream getParameters() { "BigIntVector", (Function) allocator -> new BigIntVector("vector", allocator), - TestSortingUtil.LONG_GENERATOR - )); + TestSortingUtil.LONG_GENERATOR)); params.add( Arguments.of( @@ -167,8 +169,7 @@ public static Stream getParameters() { "Float4Vector", (Function) allocator -> new Float4Vector("vector", allocator), - TestSortingUtil.FLOAT_GENERATOR - )); + TestSortingUtil.FLOAT_GENERATOR)); params.add( Arguments.of( @@ -178,8 +179,7 @@ public static Stream getParameters() { "Float8Vector", (Function) allocator -> new Float8Vector("vector", allocator), - TestSortingUtil.DOUBLE_GENERATOR - )); + TestSortingUtil.DOUBLE_GENERATOR)); } } } diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestOutOfPlaceVectorSorter.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestOutOfPlaceVectorSorter.java index 7321def91aa12..9358ef93b086e 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestOutOfPlaceVectorSorter.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestOutOfPlaceVectorSorter.java @@ -20,6 +20,7 @@ import java.util.List; import java.util.stream.Stream; import org.junit.jupiter.params.provider.Arguments; + /** Test cases for out-of-place sorters. */ public abstract class TestOutOfPlaceVectorSorter { diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestSortingUtil.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestSortingUtil.java index 19557692851f9..24b2c752d0863 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestSortingUtil.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestSortingUtil.java @@ -34,6 +34,7 @@ import org.apache.arrow.vector.VarCharVector; import org.apache.arrow.vector.testing.RandomDataGenerator; import org.apache.arrow.vector.testing.ValueVectorDataPopulator; + /** Utilities for sorting related utilities. */ public class TestSortingUtil { diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthOutOfPlaceVectorSorter.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthOutOfPlaceVectorSorter.java index 5613dbfae63a4..6addec9e266c3 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthOutOfPlaceVectorSorter.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthOutOfPlaceVectorSorter.java @@ -29,6 +29,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; + /** Test cases for {@link VariableWidthOutOfPlaceVectorSorter}. */ public class TestVariableWidthOutOfPlaceVectorSorter extends TestOutOfPlaceVectorSorter { diff --git a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthSorting.java b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthSorting.java index d55d0227ab0d7..60a5600764a36 100644 --- a/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthSorting.java +++ b/java/algorithm/src/test/java/org/apache/arrow/algorithm/sort/TestVariableWidthSorting.java @@ -25,8 +25,8 @@ import java.util.Arrays; import java.util.Comparator; import java.util.List; -import java.util.stream.Stream; import java.util.function.Function; +import java.util.stream.Stream; import org.apache.arrow.memory.BufferAllocator; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.BaseVariableWidthVector; @@ -38,6 +38,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; + /** Test sorting variable width vectors with random data. */ public class TestVariableWidthSorting> {