### Question:
AtlasDistributionSummary extends AtlasMeter implements DistributionSummary { @Override public void record(long amount) { count.getCurrent().incrementAndGet(); if (amount > 0) { total.getCurrent().addAndGet(amount); totalOfSquares.getCurrent().addAndGet((double) amount * amount); updateMax(max.getCurrent(), amount); } updateLastModTime(); } AtlasDistributionSummary(Id id, Clock clock, long ttl, long step); @Override void record(long amount); @Override long count(); @Override long totalAmount();  }### Answer:
@Test public void recordOne() { dist.record(1); checkValue(0, 0, 0, 0); clock.setWallTime(step + 1); checkValue(1, 1, 1, 1); }
@Test public void recordTwo() { dist.record(2); checkValue(0, 0, 0, 0); clock.setWallTime(step + 1); checkValue(1, 2, 4, 2); }
@Test public void recordZero() { dist.record(0); clock.setWallTime(step + 1); checkValue(1, 0, 0, 0); }
@Test public void recordNegativeValue() { dist.record(-2); clock.setWallTime(step + 1); checkValue(1, 0, 0, 0); }
@Test public void recordSeveralValues() { dist.record(1); dist.record(2); dist.record(3); dist.record(1); clock.setWallTime(step + 1); checkValue(4, 1 + 2 + 3 + 1, 1 + 4 + 9 + 1, 3); }
@Test public void rollForward() { dist.record(42); clock.setWallTime(step + 1); checkValue(1, 42, 42 * 42, 42); clock.setWallTime(step + step + 1); checkValue(0, 0, 0, 0); }
@Test public void expiration() { long start = clock.wallTime(); clock.setWallTime(start + step * 2); Assertions.assertTrue(dist.hasExpired()); dist.record(42); Assertions.assertFalse(dist.hasExpired()); clock.setWallTime(start + step * 3 + 1); Assertions.assertTrue(dist.hasExpired()); }