@Test public void hashCodeIsConstructedFromBothLineAndOffsets() { assertThat(new ProblemPosition(5).hashCode()).isEqualTo(Objects.hash(5, Optional.empty())); assertThat(new ProblemPosition(5, Range.closed(100, 200)).hashCode()) .isEqualTo(Objects.hash(5, Range.closed(100, 200))); }
@Override public int hashCode() { return Objects.hash(line, range); }
ProblemPosition { @Override public int hashCode() { return Objects.hash(line, range); } }
ProblemPosition { @Override public int hashCode() { return Objects.hash(line, range); } ProblemPosition(final int line);  ProblemPosition(final int line, final Range<Integer> range); }
ProblemPosition { @Override public int hashCode() { return Objects.hash(line, range); } ProblemPosition(final int line);  ProblemPosition(final int line, final Range<Integer> range); static ProblemPosition fromRegion(final FileRegion region); int getLine(); Optional<Range<Integer>> getRange(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); }
ProblemPosition { @Override public int hashCode() { return Objects.hash(line, range); } ProblemPosition(final int line);  ProblemPosition(final int line, final Range<Integer> range); static ProblemPosition fromRegion(final FileRegion region); int getLine(); Optional<Range<Integer>> getRange(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode();  }