### Question:
DoubleSumAggregator extends AbstractAggregator { public static AggregatorFactory getFactory() { return AGGREGATOR_FACTORY; }  static AggregatorFactory getFactory(); @Override Point toPoint(long startEpochNanos, long epochNanos, Labels labels); @Override void doRecordDouble(double value);  }### Answer:
@Test void factoryAggregation() { AggregatorFactory factory = DoubleSumAggregator.getFactory(); assertThat(factory.getAggregator()).isInstanceOf(DoubleSumAggregator.class); }
@Test void multipleRecords() { Aggregator aggregator = DoubleSumAggregator.getFactory().getAggregator(); aggregator.recordDouble(12.1); aggregator.recordDouble(12.1); aggregator.recordDouble(12.1); aggregator.recordDouble(12.1); aggregator.recordDouble(12.1); assertThat(getPoint(aggregator).getValue()).isCloseTo(12.1 * 5, offset(1e-6)); }
@Test void multipleRecords_WithNegatives() { Aggregator aggregator = DoubleSumAggregator.getFactory().getAggregator(); aggregator.recordDouble(12.1); aggregator.recordDouble(12.1); aggregator.recordDouble(-23.2); aggregator.recordDouble(12.1); aggregator.recordDouble(12.3); aggregator.recordDouble(-11.3); assertThat(getPoint(aggregator).getValue()).isCloseTo(14.1, offset(1e-6)); }
@Test void mergeAndReset() { Aggregator aggregator = DoubleSumAggregator.getFactory().getAggregator(); aggregator.recordDouble(13.1); aggregator.recordDouble(12.1); assertThat(getPoint(aggregator).getValue()).isCloseTo(25.2, offset(1e-6)); Aggregator mergedAggregator = DoubleSumAggregator.getFactory().getAggregator(); aggregator.mergeToAndReset(mergedAggregator); assertThat(getPoint(aggregator).getValue()).isCloseTo(0, offset(1e-6)); assertThat(getPoint(mergedAggregator).getValue()).isCloseTo(25.2, offset(1e-6)); aggregator.recordDouble(12.1); aggregator.recordDouble(-25.2); aggregator.mergeToAndReset(mergedAggregator); assertThat(getPoint(aggregator).getValue()).isCloseTo(0, offset(1e-6)); assertThat(getPoint(mergedAggregator).getValue()).isCloseTo(12.1, offset(1e-6)); }