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