This class uses 3 members of outer class inside accumulate() method. For me it's more natural to have inner class instead of static nested.