Github user StephanEwen commented on the issue:
https://github.com/apache/flink/pull/4844
Had an offline discussion with @tillrohrmann - rewriting this without
Mockito results in a similar amount of code with similar maintenance effort, so
seems to be okay in this case.
+1 to merge after fixing the `Thread.holdsLock(lock)` comment above---
