code: public long total(ByteBuffer context)
      {
          long total = 0L;
          // we could use a ContextState but it is easy enough that we avoid the object creation
          for (int offset = context.position() + headerLength(context); offset < context.limit(); offset += STEP_LENGTH)
              total += context.getLong(offset + CounterId.LENGTH + CLOCK_LENGTH);
          return total;
      }
docs: Returns the aggregated count across all counter ids.
  
  @param context a counter context
  @return the aggregated count represented by {@code context}