title: How to create parametrized test cases in JUnit 4 and Kotlin for Android?
body: <p>I need something similar to C# NUnit <a href="http://dotnetpattern.com/nunit-testcase-example" rel="noreferrer">TestCase</a> scenario with fixed expected results.</p>
  
  <p>I've already found this <a href="https://stackoverflow.com/questions/752521/running-the-same-junit-test-case-multiple-time-with-different-data">question</a> on SO which has great solutions but they are for Java only and as suggested in some of the answers I followed <a href="https://springframework.guru/unit-testing-junit-part-4-parameterized-theories/" rel="noreferrer">this tutorial</a>, but simply converting it to Kotlin doesn't work.</p>
  
  <pre><code>@RunWith(value = Parameterized.class)
  public class EmailIdValidatorTest {
  
      private String emailId;
      private boolean expected;
  
      public EmailIdValidatorTest(String emailId, boolean expected) {
          this.emailId = emailId;
          this.expected = expected;
      }
      @Parameterized.Parameters(name= "{index}: isValid({0})={1}")
      public static Iterable&lt;Object[]&gt; data() {
          return Arrays.asList(new Object[][]{
                          {"mary@testdomain.com", true},
                          {"mary.smith@testdomain.com", true},
                          {"mary_smith123@testdomain.com", true},
                          {"mary@testdomaindotcom", false},
                          {"mary-smith@testdomain", false},
                          {"testdomain.com", false}
                  }
          );
      }
      @Test
      public void testIsValidEmailId() throws Exception {
          boolean actual= EmailIdUtility.isValid(emailId);
          assertThat(actual, is(equalTo(expected)));
      }
  }
  </code></pre>
  
  <p>So what is the correct way to write Kotlin parametrized unit tests with JUnit?</p>