Yes, it is some solution.
Although it is not ideal solution.
Translating lyra2re algorithm step by step would be much better.
To test, if it works properly and the same way is, that for the same input value it should provide the same output value as for QT client lyra2re code.
We can e.g. prepare big text file with values to hash and generate output file with hashes and compare results to make sure that the lyra2re algorithm is the same as in QT client lyra2re code.
So far I haven't seen the lyra2re algorithm in Java. It could be translated, but that leaves much room for lots of bugs.
Ideally, we would have Java code and Native and each platform can choose which code is run based on if the correct native code is available.