Skip to content

Instantly share code, notes, and snippets.

@nothub
Last active August 13, 2020 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nothub/a84ab18b1ed46d843ba4449d398f998d to your computer and use it in GitHub Desktop.
Save nothub/a84ab18b1ed46d843ba4449d398f998d to your computer and use it in GitHub Desktop.
found somewhere on stackoverflow
package not.hub.test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class UnboxingEquals {
@Test
void sanity_check() {
// noinspection NumberEquality,SimplifiableAssertion,SimplifiableAssertion
Assertions.assertTrue((Integer.valueOf(42) == Integer.valueOf(42)) == (Integer.valueOf(420) == Integer.valueOf(420)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment