Drupal's Batch API is great, it allows you to easily perform long running processes with feedback to the user.
But during Drupal 8's development processes it was one of the remaining systems that didn't get the full object oriented, service-based architecture.
Much of the batch API is largely unchanged from Drupal 7.
But that doesn't mean you can't write unit-testable callbacks.
Let's get started.
This one tripped me up on a recent Drupal 8 project.