style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@ -10,29 +10,20 @@ public class CombinationTest {
@Test
void testNoElement() {
List<TreeSet<Integer>> result = Combination.combination(
new Integer[] { 1, 2 },
0
);
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 0);
assertTrue(result == null);
}
@Test
void testLengthOne() {
List<TreeSet<Integer>> result = Combination.combination(
new Integer[] { 1, 2 },
1
);
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 1);
assertTrue(result.get(0).iterator().next() == 1);
assertTrue(result.get(1).iterator().next() == 2);
}
@Test
void testLengthTwo() {
List<TreeSet<Integer>> result = Combination.combination(
new Integer[] { 1, 2 },
2
);
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 2);
Integer[] arr = result.get(0).toArray(new Integer[2]);
assertTrue(arr[0] == 1);
assertTrue(arr[1] == 2);