Updated code to use official JDK 8 release. Updated code with new collectingAndThen method in
Collectors. Also updated the Line to expose a stream rather than internal state.