### Question:
CsvRow { public String getValue(String header) { String value = getField(header); if (value.isEmpty()) { throw new IllegalArgumentException("No value was found for field: '" + header + "'"); } return value; } private  CsvRow(ImmutableList<String> headers, int lineNumber, ImmutableList<String> fields);   CsvRow(
      ImmutableList<String> headers,
      ImmutableMap<String, Integer> searchHeaders,
      int lineNumber,
      ImmutableList<String> fields); ImmutableList<String> headers(); int lineNumber(); ImmutableList<String> fields(); int fieldCount(); String field(int index); String getField(String header); T getField(String header, Function<String, T> postProcessor); Optional<String> findField(String header); String getField(Pattern headerPattern); T getField(Pattern headerPattern, Function<String, T> postProcessor); Optional<String> findField(Pattern headerPattern); String getValue(String header); T getValue(String header, Function<String, T> postProcessor); Optional<String> findValue(String header); String getValue(Pattern headerPattern); T getValue(Pattern headerPattern, Function<String, T> postProcessor); Optional<String> findValue(Pattern headerPattern); CsvRow subRow(int startInclusive); CsvRow subRow(int startInclusive, int endExclusive); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void test_getValue() { CsvRow row = new CsvRow(HEADERS, SEARCH_HEADERS, 1, FIELDS); assertThat(row.getValue("A")).isEqualTo("m"); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue("B")); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue("X")); assertThat(row.getValue("C", Period::parse)).isEqualTo(Period.ofDays(1)); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue("C", Integer::parseInt)); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue("X", Period::parse)); }
@Test public void test_getValue_Pattern() { CsvRow row = new CsvRow(HEADERS, SEARCH_HEADERS, 1, FIELDS); assertThat(row.getValue(Pattern.compile("A"))).isEqualTo("m"); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue(Pattern.compile("B"))); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue(Pattern.compile("X"))); assertThat(row.getValue(Pattern.compile("C"), Period::parse)).isEqualTo(Period.ofDays(1)); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue(Pattern.compile("C"), Integer::parseInt)); assertThatIllegalArgumentException().isThrownBy(() -> row.getValue(Pattern.compile("X"), Period::parse)); }