Skip to content

Commit

Permalink
Suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mlrprananta committed May 9, 2023
1 parent a98c446 commit f2fae56
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -626,20 +626,9 @@ R after(
}
}

static final class StreamConcat<T> {
@BeforeTemplate
Stream<T> before(Stream<T> s1, Stream<T> s2) {
return Stream.of(s1, s2).flatMap(Function.identity());
}

@AfterTemplate
Stream<T> after(Stream<T> s1, Stream<T> s2) {
return Stream.concat(s1, s2);
}
}

static final class StreamsConcat<T> {
@BeforeTemplate
@SuppressWarnings("StreamOfArray")
Stream<T> before(@Repeated Stream<T> stream) {
return Stream.of(Refaster.asVarargs(stream)).flatMap(Function.identity());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ ImmutableSet<Integer> testStreamFlatMapCollect() {
return Stream.of(1).collect(flatMapping(n -> Stream.of(n, n), toImmutableSet()));
}

Stream<Integer> testStreamConcat() {
return Stream.of(Stream.of(1), Stream.of(2)).flatMap(Function.identity());
}

Stream<Integer> testStreamsConcat() {
return Stream.of(Stream.of(1), Stream.of(2), Stream.of(3), Stream.of(4))
.flatMap(Function.identity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ ImmutableSet<Integer> testStreamFlatMapCollect() {
return Stream.of(1).flatMap(n -> Stream.of(n, n)).collect(toImmutableSet());
}

Stream<Integer> testStreamConcat() {
return Stream.concat(Stream.of(1), Stream.of(2));
}

Stream<Integer> testStreamsConcat() {
return Streams.concat(Stream.of(1), Stream.of(2), Stream.of(3), Stream.of(4));
}
Expand Down

0 comments on commit f2fae56

Please sign in to comment.