I have encountered the following Java syntax that I don\'t recognize.
This part is fine:
public abstract class Stream implements Iterator
ones = new Stream() { public Integer next() { return 1; } };
Assigns a new instance of an anonymous implementation of Stream (that contains a virtually unlimited number of 1s. You may find more on anonymous classes in Java In A Nutshell
Stream
1