Working example of eol and Java-based surrogate function