BAEL-581 - reformatting

This commit is contained in:
slavisa-baeldung 2017-01-17 11:31:13 +01:00
parent a7c1fb3b72
commit 543c6eeb29
1 changed files with 9 additions and 9 deletions

View File

@ -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> {