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