String expected = "Hello"; String actual = "Hello"; Assert.assertEquals(actual, expected);
int[] expected = {1, 2, 3}; int[] actual = {1, 2, 3}; Assert.assertArrayEquals(actual, expected);
boolean condition = true; Assert.assertTrue(condition);This code checks if the given boolean condition is true using the assertTrue() method. The org.testng.Assert package library belongs to the TestNG testing framework, which is an open-source Java testing library. It provides various features like annotations, assertions, test runners, and reporting. By using Assert, developers can easily verify the code behavior in different scenarios and make sure that their code is working as expected.