Use OnSuccess instead of JavaPartialFunction