@Test
public void testAggregateTargetMetrics() {

    final TargetMetrics targetMetrics = COUNTER_REGISTRY.aggregateTargetMetrics(CONNECTION_ID);
    final Measurement[] expected = {
            getMeasurement(MAPPED, true),
            getMeasurement(MAPPED, false),
            getMeasurement(DISPATCHED, true),
            getMeasurement(DISPATCHED, false),
            getMeasurement(FILTERED, true),
            getMeasurement(FILTERED, false),
            getMeasurement(PUBLISHED, true),
            getMeasurement(PUBLISHED, false)
    };
    assertThat(targetMetrics.getAddressMetrics().get(TARGET).getMeasurements()).containsExactlyInAnyOrder(expected);
}