@Test
    final void smokeTest() {
        String metricName = "testMetric";
        Bucket first = new Bucket();
        for (int i = 0; i < 4; ++i) {
            populateSingleValue(metricName, first, i);
        }
        cache.updateDimensionPersistence(null, first);
        Bucket second = new Bucket();
        final int newest = 42;
        populateSingleValue(metricName, second, newest);
        cache.updateDimensionPersistence(first, second);
        assertEquals(POINTS_TO_KEEP, second.getValuesForMetric(metricName).size());
        boolean newestFound = false;
        for (Entry<Point, UntypedMetric> x : second.getValuesForMetric(metricName)) {
            if (x.getValue().getLast() == newest) {
                newestFound = true;
            }
        }
        assertTrue(newestFound, "Kept newest measurement when padding points.");
    }
Functional test for point persistence layer.

@author Steinar Knutsen
container-core/src/test/java/com/yahoo/metrics/simple/DimensionsCacheTest.java