Unify tie-logic between generated Java model code and interpreted model.
Extracted code for getPredict into a dedicated class.

The objective of this refactoring is to share the code
between interpretter and generated model code.