This is a simple Java implementation of the C algorithm in the pdf paper within this directory.
Use it to read about the elegant C code that inspired this, and the java implementation I wrote.
If you'd like, add a bunch of tests. And then submit a pull request.
-kyounger