### Question:
Streams { public static <T> Stream<T> enumerationStream(Enumeration<T> enumeration) { requireNonNull(enumeration); return StreamSupport.stream(new Spliterators.AbstractSpliterator<>(Long.MAX_VALUE, Spliterator.ORDERED) { @Override public boolean tryAdvance(Consumer<? super T> action) { if (enumeration.hasMoreElements()) { action.accept(enumeration.nextElement()); return true; } return false; } }, false); } private  Streams(); static OutputStream nullOutputStream(); static PrintStream nullPrintStream(); static Stream<T> enumerationStream(Enumeration<T> enumeration);  }### Answer:
@Test void shouldStreamAnEnumeration() { Enumeration<String> enumeration = Collections.enumeration(Arrays.asList("RED", "BLUE", "GREEN")); List<String> result = enumerationStream(enumeration).map(String::toLowerCase).collect(Collectors.toList()); assertEquals(Arrays.asList("red", "blue", "green"), result); }