@SuppressWarnings("JavaUtilDate")
  protected LocalTime convertTimeValue(Object value) {
    if (value instanceof Number) {
      long millis = ((Number) value).longValue();
      return DateTimeUtil.timeFromMicros(millis * 1000);
    } else if (value instanceof String) {
      return LocalTime.parse((String) value);
    } else if (value instanceof LocalTime) {
      return (LocalTime) value;
    } else if (value instanceof Date) {
      long millis = ((Date) value).getTime();
      return DateTimeUtil.timeFromMicros(millis * 1000);
    }
    throw new RuntimeException("Cannot convert time: " + value);
  }
@Test
  public void testTimeConversion() {
    Table table = mock(Table.class);
    when(table.schema()).thenReturn(SIMPLE_SCHEMA);
    RecordConverter converter = new RecordConverter(table, config);

    LocalTime expected = LocalTime.of(7, 51, 30, 888_000_000);

    List<Object> inputList =
        ImmutableList.of(
            "07:51:30.888",
            expected.toNanoOfDay() / 1000 / 1000,
            expected,
            new Date(expected.toNanoOfDay() / 1000 / 1000));

    inputList.forEach(
        input -> {
          Temporal ts = converter.convertTimeValue(input);
          assertThat(ts).isEqualTo(expected);
        });
  }