@Test public void testSameHashCodes() { PendingToken instance1 = new PendingToken("a", 0, 1); assertEquals("PendingToken default nonpos", false, instance1.nonpos); PendingToken instance2 = new PendingToken("a", 0, 1); instance2.nonpos = true; assertEquals("PendingToken instance HashCode ignores nonpos", instance1.hashCode(), instance2.hashCode()); }
@Override public int hashCode() { return Objects.hash(str, start, end); }
PendingToken { @Override public int hashCode() { return Objects.hash(str, start, end); } }
PendingToken { @Override public int hashCode() { return Objects.hash(str, start, end); } PendingToken(String str, int start, int end); }
PendingToken { @Override public int hashCode() { return Objects.hash(str, start, end); } PendingToken(String str, int start, int end); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
PendingToken { @Override public int hashCode() { return Objects.hash(str, start, end); } PendingToken(String str, int start, int end); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); final String str; final int start; final int end; public boolean nonpos; }