Skip to content

Instantly share code, notes, and snippets.

@hanbei
Created February 15, 2018 12:38
Show Gist options
  • Save hanbei/6f9819507ba6645e88cc79054db84067 to your computer and use it in GitHub Desktop.
Save hanbei/6f9819507ba6645e88cc79054db84067 to your computer and use it in GitHub Desktop.
ImmutableMap hasCode Bug
public void testHashCode() {
ImmutableMap<String, Object> f1 = ImmutableMap.of("test", "test", "test2", "test2");
ImmutableMap<String, Object> f2 = ImmutableMap.of("test2", "test2", "test3", "test3");
assertFalse(f1.equals(f2));
int hcf1 = f1.hashCode();
int hcf2 = f2.hashCode();
assertThat(hcf1, not(hcf2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment