Review completely the javalib

Always test this. (i.e. drop if, `expect(bos.flushed).toEqual(testFlushed)` or equiv.)