@Test public void testAge() { int age = 25; AssertJUnit.assertTrue(age >= 18); }
@Test public void testArray() { int[] numbers = {1, 2, 3, 4, 5}; AssertJUnit.assertTrue(numbers.length > 0); }This example uses the `assertTrue()` method to check if the length of the numbers array is greater than 0. If the condition is true, the test passes. Otherwise, the test fails. In both examples, the `org.testng.AssertJUnit` package library is used to perform the assertion.