### Question:
LongSumAggregator extends AbstractAggregator { public static AggregatorFactory getFactory() { return AGGREGATOR_FACTORY; }  static AggregatorFactory getFactory(); @Override Point toPoint(long startEpochNanos, long epochNanos, Labels labels); @Override void doRecordLong(long value);  }### Answer:
@Test void factoryAggregation() { AggregatorFactory factory = LongSumAggregator.getFactory(); assertThat(factory.getAggregator()).isInstanceOf(LongSumAggregator.class); }
@Test void multipleRecords() { Aggregator aggregator = LongSumAggregator.getFactory().getAggregator(); aggregator.recordLong(12); aggregator.recordLong(12); aggregator.recordLong(12); aggregator.recordLong(12); aggregator.recordLong(12); assertThat(getPoint(aggregator).getValue()).isEqualTo(12 * 5); }
@Test void multipleRecords_WithNegatives() { Aggregator aggregator = LongSumAggregator.getFactory().getAggregator(); aggregator.recordLong(12); aggregator.recordLong(12); aggregator.recordLong(-23); aggregator.recordLong(12); aggregator.recordLong(12); aggregator.recordLong(-11); assertThat(getPoint(aggregator).getValue()).isEqualTo(14); }
@Test void mergeAndReset() { Aggregator aggregator = LongSumAggregator.getFactory().getAggregator(); aggregator.recordLong(13); aggregator.recordLong(12); assertThat(getPoint(aggregator).getValue()).isEqualTo(25); Aggregator mergedAggregator = LongSumAggregator.getFactory().getAggregator(); aggregator.mergeToAndReset(mergedAggregator); assertThat(getPoint(aggregator).getValue()).isEqualTo(0); assertThat(getPoint(mergedAggregator).getValue()).isEqualTo(25); aggregator.recordLong(12); aggregator.recordLong(-25); aggregator.mergeToAndReset(mergedAggregator); assertThat(getPoint(aggregator).getValue()).isEqualTo(0); assertThat(getPoint(mergedAggregator).getValue()).isEqualTo(12); }