Rosin thresholding (Unimodal thresholding)

I have to do for my project many image filters (all you can imagine) in JAVA (I use JAVA JAI). I have done all except unimodal thresholding by Paul L. Rosin. I found only document and implementation in c++. Unfortunately, I'm terrible in c ++. Can you help me please? Thanks!