BasePlaceholder extends com.tngtech.junit.dataprovider.placeholder.BasePlaceholder { public void setContext(Method method, int idx, Object[] parameters) { this.method = method; this.idx = idx; this.parameters = Arrays.copyOf(parameters, parameters.length); } BasePlaceholder(String placeholderRegex); void setContext(Method method, int idx, Object[] parameters); String process(String formatPattern);  }
@Test public void testSetContextShouldSetAllContextFields() { Method method = anyMethod(); int index = 0; Object[] parameters = new Object[] { 1, 2, 3 }; BasePlaceholder underTest = new TestPlaceholder("%s", "###"); underTest.method = null; underTest.idx = Integer.MAX_VALUE; underTest.parameters = null; underTest.setContext(method, index, parameters); assertThat(underTest.method).isEqualTo(method); assertThat(underTest.idx).isEqualTo(index); assertThat(underTest.parameters).isNotSameAs(parameters).isEqualTo(parameters); }