1import org.junit.Test;2import org.junit.runner.RunWith;3import org.junit.runners.Parameterized;4import org.junit.runners.Parameterized.Parameters;5import org.junit.runners.Parameterized.Parameter;6import static org.junit.Assert.assertEquals;7import static org.junit.Assert.assertTrue;8import static org.junit.Assert.assertFalse;9import static org.junit.Assert.assertNotNull;10import static org.junit.Assert.assertNull;11import static org.junit.Assert.assertSame;12import static org.junit.Assert.assertNotSame;13@RunWith(Parameterized.class)14public class TestJunit4 {15 public String methodToTest(int num1, int num2) {16 if (num1 == num2) {17 return "Equal";18 } else {19 return "Not Equal";20 }21 }22 public String methodToTest(String str1, String str2) {23 if (str1.equals(str2)) {24 return "Equal";25 } else {26 return "Not Equal";27 }28 }29 public static Collection<Object[]> data() {30 return Arrays.asList(new Object[][] {31 { 1, 1, "Equal" },32 { 2, 2, "Equal" },33 { 3, 3, "Equal" },34 { 4, 4, "Equal" },35 { 5, 5, "Equal" },36 { 6, 6, "Equal" },37 { 7, 7, "Equal" },38 { 8, 8, "Equal" },39 { 9, 9, "Equal" },40 { 10, 10, "Equal" },41 { 1, 2, "Not Equal" },42 { 2, 3, "Not Equal" },43 { 3, 4, "Not Equal" },44 { 4, 5, "Not Equal" },45 { 5, 6, "Not Equal" },46 { 6, 7, "Not Equal" },47 { 7, 8, "Not Equal" },48 { 8