Perhaps there was a constraint to use Java lang and not Scala, thus Scalaz probably can't apply here.
But I'm sure Java has some similar deterministic abstraction. I know Java used to just use deterministic functions + exceptions, and that was hardly unreasonable.