// When
String tableDefaultsAsString = "|three|\n|99|";
ExamplesTable defaultsTable = factory.createExamplesTable(tableDefaultsAsString);
Parameters defaults = defaultsTable.getRowAsParameters(0);
String tableAsString = "|one|\n|11|\n|22|";
ExamplesTable examplesTable = factory.createExamplesTable(tableAsString).withDefaults(defaults);
// Then
Parameters firstRow = examplesTable.getRowAsParameters(0);
Map<String, String> firstRowValues = firstRow.values();
assertThat(firstRowValues.containsKey("one"), is(true));
assertThat(firstRow.valueAs("one", String.class), is("11"));
assertThat(firstRow.valueAs("one", Integer.class), is(11));
assertThat(firstRowValues.containsKey("three"), is(true));
assertThat(firstRow.valueAs("three", String.class), is("99"));
assertThat(firstRow.valueAs("three", Integer.class), is(99));
assertThat(firstRowValues.containsKey("XX"), is(false));
assertThat(firstRow.valueAs("XX", Integer.class, 13), is(13));
Parameters secondRow = examplesTable.getRowAsParameters(1);
Map<String, String> secondRowValues = secondRow.values();
assertThat(secondRowValues.containsKey("one"), is(true));
assertThat(secondRow.valueAs("one", String.class), is("22"));
assertThat(secondRow.valueAs("one", Integer.class), is(22));
assertThat(secondRowValues.containsKey("three"), is(true));
assertThat(secondRow.valueAs("three", String.class), is("99"));
assertThat(secondRow.valueAs("three", Integer.class), is(99));
assertThat(secondRowValues.containsKey("XX"), is(false));
assertThat(secondRow.valueAs("XX", Integer.class, 13), is(13));
}