prefer doWhenDone(@NotNull final Consumer<T> consumer)
(cherry picked from commit 57b9e44)