DoubleAdder extends Number implements Comparable<DoubleAdder> { public boolean sameState(final DoubleAdder other) { return Double.compare(_sum, other._sum) == 0 && Double.compare(_simpleSum, other._simpleSum) == 0 && Double.compare(_compensation, other._compensation) == 0; } DoubleAdder(final double value);  DoubleAdder(); DoubleAdder set(final double value); DoubleAdder set(final DoubleAdder value); DoubleAdder add(final double value); DoubleAdder add(final double[] values); DoubleAdder add(final DoubleAdder value); DoubleAdder combine(final DoubleAdder other); double value(); @Override int intValue(); @Override long longValue(); @Override float floatValue(); @Override double doubleValue(); @Override int compareTo(final DoubleAdder other); boolean sameState(final DoubleAdder other); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static double sum(final double[] values);  }
@Test public void sameState() { final DoubleAdder da1 = with(new Random(589), r -> factory().newInstance()); final DoubleAdder da2 = with(new Random(589), r -> factory().newInstance()); Assert.assertTrue(da1.sameState(da2)); final Random random = new Random(); for (int i = 0; i < 100; ++i) { final double value = random.nextDouble(); da1.add(value); da2.add(value); Assert.assertTrue(da1.sameState(da2)); } }