Skip to content

Commit

Permalink
[#54] StreamExHeadTailTest: test for mapFirst/forEachOrTail
Browse files Browse the repository at this point in the history
  • Loading branch information
amaembo committed Jan 18, 2016
1 parent 0af7701 commit cab639c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/one/util/streamex/StreamExHeadTailTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,5 +476,10 @@ public void testHeadTailSimple() {
streamEx(() -> StreamEx.of("a", "b", "c", "d"), s -> assertEquals(Collections.singletonMap("a", asList("b",
"c", "d")), s.get().headTail((x, str) -> str.mapToEntry(e -> x, e -> e)).mapToEntry(Entry::getKey,
Entry::getValue).grouping()));
assertEquals(asList("b:c", "c:d"), StreamEx.of(":", "b", "c", "d").headTail(
(head, tail) -> tail.pairMap((left, right) -> left + head + right)).toList());
assertEquals(asList("b:", "c", "d"), StreamEx.of(":", "b", "c", "d").headTail(
(head, tail) -> tail.mapFirst(first -> first + head)).toList());

}
}

0 comments on commit cab639c

Please sign in to comment.