Streams from SICP 3.5 in Java