java Iterable to list code example
Example: java Iterable to list
@Test
public void whenConvertIterableToListUsingJava8_thenSuccess() {
List result = new ArrayList();
iterable.forEach(result::add);
assertThat(result, contains("john", "tom", "jane"));
}