Free Monad in Java