This method that Is needed to pass the following test cases how would I go about creating
Fantastic news! We've Found the answer you've been seeking!
Question:
This method that Is needed to pass the following test cases how would I go about creating a hash code method to pass these test cases assuming we have a head, tail and a list value already declared
@Test
void testHashCode() {
var list = List.make(1, 2, 3, 4, 5);
int hash = list.hashCode();
assertEquals(hash, list.hashCode());
assertEquals(hash, List.make(1, 2, 3, 4, 5).hashCode());
assertNotEquals(hash, List.make(1, 2, 3, 4).hashCode());
}
@Override
public int hashCode() {
// To Implement
return 0;
}
Related Book For
Introduction to Managerial Accounting
ISBN: 978-1259105708
5th Canadian edition
Authors: Peter C. Brewer, Ray H. Garrison, Eric Noreen, Suresh Kalagnanam, Ganesh Vaidyanathan
Posted Date: