translated paramaxflow example to java, implemented all necessary wrappers