### Question:
AdditiveBoostFunction extends ValueSource { @Override public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof AdditiveBoostFunction)) { return false; } final AdditiveBoostFunction that = (AdditiveBoostFunction) o; if (this.isNegBoost != that.isNegBoost || this.boostValue != that.boostValue) { return false; } return this.scoringFunction.equals(that.scoringFunction); } AdditiveBoostFunction(final ValueSource scoringFunction, final float boost); @Override FunctionValues getValues(final Map context, final LeafReaderContext readerContext); @Override boolean equals(final Object o); @Override int hashCode(); @Override String description();  }### Answer:
@Test public void testEquals() { final AdditiveBoostFunction func1 = new AdditiveBoostFunction(new DoubleConstValueSource(Math.PI), 1f); final AdditiveBoostFunction func2 = new AdditiveBoostFunction(new DoubleConstValueSource(Math.PI), 1f); final AdditiveBoostFunction func3 = new AdditiveBoostFunction(new DoubleConstValueSource(Math.E), 1f); final AdditiveBoostFunction func4 = new AdditiveBoostFunction(new DoubleConstValueSource(Math.E), 2f); final AdditiveBoostFunction func5 = new AdditiveBoostFunction(new DoubleConstValueSource(Math.E), -2f); final AdditiveBoostFunction func6 = new AdditiveBoostFunction(new DoubleConstValueSource(Math.E), -2f); assertEquals(func1, func1); assertEquals(func1, func2); assertEquals(func2, func1); assertEquals(func2, func2); assertEquals(func5, func6); assertFalse(func1.equals(null)); assertNotEquals(func3, func1); assertNotEquals(func3, func4); assertNotEquals(func4, func5); }