Complete the code to import the JUnit test annotation.
import org.junit.[1];
The @Test annotation marks a method as a test method in JUnit.
Complete the code to assert that two values are equal in a test.
assertEquals([1], actualValue);The assertEquals method compares the expected value to the actual value.
Fix the error in the test method declaration by completing the annotation.
@[1] public void testAddition() { assertEquals(5, Calculator.add(2, 3)); }
The @Test annotation is required to tell JUnit this method is a test.
Fill both blanks to create a test method that checks if a list is empty.
@[1] public void testListEmpty() { List<String> list = new ArrayList<>(); assertTrue(list.[2]()); }
size() without comparing to zero.The method is marked with @Test and uses isEmpty() to check if the list has no elements.
Fill all three blanks to write a test that checks if a string contains a substring.
@[1] public void testContains() { String text = "hello world"; assertTrue(text.[2]("[3]")); }
startsWith instead of contains.The test method is annotated with @Test. It uses the contains method to check if the string includes the substring "world".