int expected = 5; int actual = x + 2; assertEquals(expected, actual);
boolean isOpen = true; assertTrue(isOpen);
boolean isClosed = false; assertFalse(isClosed);
Object obj = null; assertNull(obj);
String str = "Hello"; assertNotNull(str);These methods are part of the org.junit.Assert class which is included in the JUnit library. To use them, you must import the JUnit library in your project either by downloading it or adding it as a dependency in your build file.