BAEL-581 - reformatting
This commit is contained in:
parent
a7c1fb3b72
commit
543c6eeb29
|
@ -18,19 +18,19 @@ public class IterableStreamConversionTest {
|
|||
|
||||
@Test
|
||||
public void givenIterable_whenConvertedToStream_thenNotNull() {
|
||||
String[] names = { "Testing", "Iterable", "conversion", "to", "Stream" };
|
||||
String[] names = {"Testing", "Iterable", "conversion", "to", "Stream"};
|
||||
StreamIterable<String> iterable = new StreamIterable<>(names);
|
||||
Assert.assertNotNull(StreamSupport.stream(iterable.spliterator(), false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void whenConvertedToList_thenCorrect() {
|
||||
String[] names = { "Testing", "Iterable", "conversion", "to", "Stream" };
|
||||
StreamIterable<String> iterable = new StreamIterable<>(names);
|
||||
Stream<String> convertedStream = StreamSupport.stream(iterable.spliterator(), false);
|
||||
List<String> collected = convertedStream.map(String::toUpperCase).collect(Collectors.toList());
|
||||
assertThat(collected, contains("TESTING", "ITERABLE", "CONVERSION", "TO", "STREAM"));
|
||||
}
|
||||
@Test
|
||||
public void whenConvertedToList_thenCorrect() {
|
||||
String[] names = {"Testing", "Iterable", "conversion", "to", "Stream"};
|
||||
StreamIterable<String> iterable = new StreamIterable<>(names);
|
||||
Stream<String> convertedStream = StreamSupport.stream(iterable.spliterator(), false);
|
||||
List<String> collected = convertedStream.map(String::toUpperCase).collect(Collectors.toList());
|
||||
assertThat(collected, contains("TESTING", "ITERABLE", "CONVERSION", "TO", "STREAM"));
|
||||
}
|
||||
}
|
||||
|
||||
class StreamIterable<T> implements Iterable<T> {
|
||||
|
|
Loading…
Reference in New Issue