To effectively benefit from unit tests it is frequently necessary to optimize production code. The following sections show some of the possibilities. The common pattern is as usual to delegate the detailed work to a helper class which is approriately instantiated.