Make tests pass with a prejava8 (imperative) solution.