The `assertNotSame` method is part of the `junit.framework.Assert` class in the JUnit library, which provides a set of assertion methods used for testing Java code. This method verifies that two objects refer to different objects in memory.
This assertion passes, because s1 and s2 refer to different objects in memory - s1 is a string literal stored in the string pool, while s2 is a new object created with the `new` operator.
Java Assert.assertNotSame - 30 examples found. These are the top rated real world Java examples of junit.framework.Assert.assertNotSame extracted from open source projects. You can rate examples to help us improve the quality of examples.