@Test void givenValuesAreEqualItShouldReturnTrue() { LongComparisonStep<TestData> hashStep = new LongComparisonStep<>(TestData::getValue); boolean result = hashStep.isEqual(new TestData(1234L), new TestData(1234L)); assertThat(result) .isTrue(); }
@Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsLong(object1) == valueExtractor.applyAsLong(object2); }
LongComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsLong(object1) == valueExtractor.applyAsLong(object2); } }
LongComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsLong(object1) == valueExtractor.applyAsLong(object2); } LongComparisonStep(ToLongFunction<? super T> valueExtractor); }
LongComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsLong(object1) == valueExtractor.applyAsLong(object2); } LongComparisonStep(ToLongFunction<? super T> valueExtractor); @Override boolean isEqual(T object1, T object2); }
LongComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsLong(object1) == valueExtractor.applyAsLong(object2); } LongComparisonStep(ToLongFunction<? super T> valueExtractor); @Override boolean isEqual(T object1, T object2);  }