ImmutableRowData implements RowData { @Override public boolean containsField(final String fieldName) { return this.index.containsKey(fieldName); } ImmutableRowData(final List<FieldData> fields); FieldData getFieldBy(final String fieldName); @Override boolean containsField(final String fieldName); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }
@Test public void containsField_ofExistingField_should_returnTrue() { final String fieldName = "A"; final FieldData existingField = field(fieldName, "foo"); final ImmutableRowData row = new ImmutableRowData(fields(existingField)); assertThat(row.containsField(fieldName), is(true)); }
@Test public void containsField_ofNonExistingField_should_returnFalse() { final String fieldName = "A"; final FieldData existingField = field(fieldName, "foo"); final ImmutableRowData row = new ImmutableRowData(fields(existingField)); assertThat(row.containsField("B"), is(false)); }