@Test void givenValuesAreEqualItShouldReturnTrue() { CharComparisonStep<TestData> hashStep = new CharComparisonStep<>(TestData::getValue); boolean result = hashStep.isEqual(new TestData('c'), new TestData('c')); assertThat(result) .isTrue(); }
@Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsChar(object1) == valueExtractor.applyAsChar(object2); }
CharComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsChar(object1) == valueExtractor.applyAsChar(object2); } }
CharComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsChar(object1) == valueExtractor.applyAsChar(object2); } CharComparisonStep(ToCharFunction<? super T> valueExtractor); }
CharComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsChar(object1) == valueExtractor.applyAsChar(object2); } CharComparisonStep(ToCharFunction<? super T> valueExtractor); @Override boolean isEqual(T object1, T object2); }
CharComparisonStep implements ComparisonStep<T> { @Override public boolean isEqual(T object1, T object2) { return valueExtractor.applyAsChar(object1) == valueExtractor.applyAsChar(object2); } CharComparisonStep(ToCharFunction<? super T> valueExtractor); @Override boolean isEqual(T object1, T object2);  }