Created
February 15, 2018 12:38
-
-
Save hanbei/6f9819507ba6645e88cc79054db84067 to your computer and use it in GitHub Desktop.
ImmutableMap hasCode Bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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