### Question:
FallbackColumnValue extends AbstractColumnValue<T> { @Override public T getValue(final Row row) { T value; try { value = primaryColumn.getValue(row); } catch (IllegalArgumentException iae) { value = null; } if (condition.matches(value)) { try { value = fallbackColumn.getValue(row); } catch (IllegalArgumentException iae) { value = null; } } return value; } @JsonCreator @SuppressWarnings("unchecked")  FallbackColumnValue(@JsonProperty("primaryColumn") final ColumnValue<T> primary,
                               @JsonProperty("fallbackColumn") final ColumnValue<T> fallback,
                               @JsonProperty("fallbackIf") final MappingPredicate<T> fallIf,
                               @JsonProperty(value="multiKey", required=false) final String multiKey); @JsonProperty("primaryColumn") final ColumnValue<T> getPrimaryColumn(); @JsonProperty("fallbackColumn") final ColumnValue<T> getFallbackColumn(); @JsonProperty("fallbackIf") MappingPredicate<T> getFallbackIf(); @Override int getSortColumn(); @Override T getValue(final Row row);  }### Answer:
@Test public void testGetValue_PrimaryValid() { when(primary.getValue(row)).thenReturn(PRIMARY_VAL); when(fallbackIf.matches(PRIMARY_VAL)).thenReturn(false); assertEquals(PRIMARY_VAL, instance.getValue(row)); }
@Test public void testGetValue_PrimaryNull() { when(primary.getValue(row)).thenReturn(null); when(fallback.getValue(row)).thenReturn(FALLBACK_VAL); assertEquals(FALLBACK_VAL, instance.getValue(row)); verify(fallbackIf, never()).matches(any()); }
@Test public void testGetValue_PrimaryInvalid() { when(primary.getValue(row)).thenReturn(PRIMARY_VAL); when(fallback.getValue(row)).thenReturn(FALLBACK_VAL); when(fallbackIf.matches(PRIMARY_VAL)).thenReturn(true); assertEquals(FALLBACK_VAL, instance.getValue(row)); }
@Test public void testGetValue_PrimaryIllegalArg() { when(primary.getValue(row)).thenThrow(new IllegalArgumentException()); when(fallback.getValue(row)).thenReturn(FALLBACK_VAL); assertEquals(FALLBACK_VAL, instance.getValue(row)); verify(fallbackIf, never()).matches(any()); }
@Test public void testGetValue_FallbackNull() { when(primary.getValue(row)).thenReturn(null); when(fallback.getValue(row)).thenReturn(null); assertNull(instance.getValue(row)); verify(fallbackIf, never()).matches(any()); }
@Test public void testGetValue_FallbackIllegalArg() { when(primary.getValue(row)).thenReturn(null); when(fallback.getValue(row)).thenThrow(new IllegalArgumentException()); assertNull(instance.getValue(row)); verify(fallbackIf, never()).matches(any()); }