The issue with @java(...) operations is that they encourage fragments of Java code being spread throughout the rulebase, resulting in code duplication that is also hard to independently test.
The recommendation is to encapsulate the behavior you would have used in a @java(...) operation into a Function rule, which:
Can be reused, resulting in only one implementation of the behavior in your rulebase
Can have test cases built to verify its correct operation ... now and in the future. As of 8.5 this can be done by implementing an Activity or Data Transform that calls the Function, then implement PegaUnit test cases on the calling rule which in turn wind up calling the Function.