It's not a big deal, but I prefer having an explicit Supplier subclass declared separately and construct that class in these places, instead of using an anonymous class. This has more code duplication.