Skip to content

Commit 4603965

Browse files
committed
use Collections.swap()
1 parent 563cf39 commit 4603965

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mug/src/test/java/com/google/mu/util/stream/PermutationTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static java.util.Collections.swap;
55

66
import java.util.ArrayList;
7+
import java.util.Collection;
78
import java.util.List;
89
import java.util.Set;
910
import java.util.stream.IntStream;
@@ -35,7 +36,7 @@ public class PermutationTest {
3536
.containsExactly(List.of(1, 2, 3), List.of(1, 3, 2), List.of(2, 1, 3), List.of(2, 3, 1), List.of(3, 1, 2), List.of(3, 2, 1));
3637
}
3738

38-
static <T> Stream<ImmutableList<T>> permute(Set<T> elements) {
39+
static <T> Stream<ImmutableList<T>> permute(Collection<T> elements) {
3940
class Permutation extends Iteration<ImmutableList<T>> {
4041
Permutation() {
4142
lazily(() -> next(new ArrayList<>(elements), 0));

0 commit comments

Comments
 (0)