+class BitCountingGroupList(list):
+ """List of BitCountingGroup which tracks overall bit count.
+
+ This is useful, as bit count of a subsequent group
+ depends on average of the previous group.
+ Having the logic encapsulated here spares the caller
+ the effort to pass averages around.
+
+ Method with_value_added_to_last_group() delegates to BitCountingGroup,
+ with_group_appended() adds new group with recalculated bits.
+
+ TODO: last_group.metadata_factory.max_value in with_group_appended()
+ is ugly, find a more natural class design.
+ """