@Test void givenValuesAreNotEqualItShouldReturnFalse() { DoubleComparisonStep<TestData> hashStep = new DoubleComparisonStep<>(TestData::getValue); boolean result = hashStep.isEqual(new TestData(1234.0), new TestData(1337.0)); assertThat(result) .isFalse(); }
@Override public boolean isEqual(T object1, T object2) { double value1 = valueExtractor.applyAsDouble(object1); double value2 = valueExtractor.applyAsDouble(object2); return doubleToLongBits(value1) == doubleToLongBits(value2); }
DoubleComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { double value1 = valueExtractor.applyAsDouble(object1); double value2 = valueExtractor.applyAsDouble(object2); return doubleToLongBits(value1) == doubleToLongBits(value2); } }
DoubleComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { double value1 = valueExtractor.applyAsDouble(object1); double value2 = valueExtractor.applyAsDouble(object2); return doubleToLongBits(value1) == doubleToLongBits(value2); } DoubleComparisonStep(ToDoubleFunction<? super T> valueExtractor); }
DoubleComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { double value1 = valueExtractor.applyAsDouble(object1); double value2 = valueExtractor.applyAsDouble(object2); return doubleToLongBits(value1) == doubleToLongBits(value2); } DoubleComparisonStep(ToDoubleFunction<? super T> valueExtractor); @Override boolean isEqual(T object1, T object2); }
DoubleComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { double value1 = valueExtractor.applyAsDouble(object1); double value2 = valueExtractor.applyAsDouble(object2); return doubleToLongBits(value1) == doubleToLongBits(value2); } DoubleComparisonStep(ToDoubleFunction<? super T> valueExtractor); @Override boolean isEqual(T object1, T object2);  }