Port of github.com/kneath/kss to Java