mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
General performance improvement (#6078)
This commit is contained in:
committed by
GitHub
parent
7b962a4a1d
commit
df0c997e4b
@@ -1,9 +1,11 @@
|
||||
package com.thealgorithms.greedyalgorithms;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ActivitySelectionTest {
|
||||
@@ -24,7 +26,7 @@ public class ActivitySelectionTest {
|
||||
int[] end = {2};
|
||||
|
||||
ArrayList<Integer> result = ActivitySelection.activitySelection(start, end);
|
||||
ArrayList<Integer> expected = new ArrayList<>(Arrays.asList(0));
|
||||
List<Integer> expected = singletonList(0);
|
||||
|
||||
assertEquals(expected, result);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.thealgorithms.greedyalgorithms;
|
||||
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class CoinChangeTest {
|
||||
@@ -16,7 +18,7 @@ public class CoinChangeTest {
|
||||
|
||||
@Test
|
||||
public void testCoinChangeProblemWithLargeAmount() {
|
||||
ArrayList<Integer> expected = new ArrayList<>(Arrays.asList(2000));
|
||||
List<Integer> expected = singletonList(2000);
|
||||
ArrayList<Integer> coins = CoinChange.coinChangeProblem(2000);
|
||||
assertEquals(expected, coins);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user