protected long convertLong(Object value) {
    if (value instanceof Number) {
      return ((Number) value).longValue();
    } else if (value instanceof String) {
      return Long.parseLong((String) value);
    }
    throw new IllegalArgumentException("Cannot convert to long: " + value.getClass().getName());
  }
@Test
  public void testLongConversion() {
    Table table = mock(Table.class);
    when(table.schema()).thenReturn(SIMPLE_SCHEMA);

    RecordConverter converter = new RecordConverter(table, config);

    long expectedLong = 123L;

    ImmutableList.of("123", 123.0f, 123.0d, 123, expectedLong)
        .forEach(
            input -> {
              long val = converter.convertLong(input);
              assertThat(val).isEqualTo(expectedLong);
            });
  }