protected int convertInt(Object value) {
    if (value instanceof Number) {
      return ((Number) value).intValue();
    } else if (value instanceof String) {
      return Integer.parseInt((String) value);
    }
    throw new IllegalArgumentException("Cannot convert to int: " + value.getClass().getName());
  }
@Test
  public void testIntConversion() {
    Table table = mock(Table.class);
    when(table.schema()).thenReturn(SIMPLE_SCHEMA);

    RecordConverter converter = new RecordConverter(table, config);

    int expectedInt = 123;

    ImmutableList.of("123", 123.0f, 123.0d, 123L, expectedInt)
        .forEach(
            input -> {
              int val = converter.convertInt(input);
              assertThat(val).isEqualTo(expectedInt);
            });
  }