### Question:
GnssPositionMode { @Override public int hashCode() { return Arrays.hashCode( new Object[]{mode, recurrence, minInterval, preferredAccuracy, preferredTime, lowPowerMode, getClass()}); } GnssPositionMode(int mode, int recurrence, int minInterval,
            int preferredAccuracy, int preferredTime, boolean lowPowerMode); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void testHashCode() { assertThat(positionMode1.hashCode()).isEqualTo(positionMode2.hashCode()); assertThat(positionMode1.hashCode()).isNotEqualTo(positionMode3.hashCode()); assertThat(positionMode1.hashCode()).isNotEqualTo(positionMode3.hashCode()); HashSet<Integer> hashSet = new HashSet<>(); hashSet.add(positionMode1.hashCode()); hashSet.add(positionMode2.hashCode()); assertThat(hashSet.size()).isEqualTo(1); hashSet.add(positionMode3.hashCode()); assertThat(hashSet.size()).isEqualTo(2); }