protected double convertDouble(Object value) {
    if (value instanceof Number) {
      return ((Number) value).doubleValue();
    } else if (value instanceof String) {
      return Double.parseDouble((String) value);
    }
    throw new IllegalArgumentException("Cannot convert to double: " + value.getClass().getName());
  }
@Test
  public void testDoubleConversion() {
    Table table = mock(Table.class);
    when(table.schema()).thenReturn(SIMPLE_SCHEMA);

    RecordConverter converter = new RecordConverter(table, config);

    double expectedDouble = 123d;

    ImmutableList.of("123", 123, 123L, 123f, expectedDouble)
        .forEach(
            input -> {
              double val = converter.convertDouble(input);
              assertThat(val).isEqualTo(expectedDouble);
            });
  }