static <T> @Nullable JdbcReadWithPartitionsHelper<T> getPartitionsHelper(TypeDescriptor<T> type) {
    // This cast is unchecked, thus this is a small type-checking risk. We just need
    // to make sure that all preset helpers in `JdbcUtil.PRESET_HELPERS` are matched
    // in type from their Key and their Value.
    return (JdbcReadWithPartitionsHelper<T>) PRESET_HELPERS.get(type.getRawType());
  }
@Test
  public void testDatetimePartitioningWithMultiKey() {
    JdbcReadWithPartitionsHelper<DateTime> helper =
        JdbcUtil.getPartitionsHelper(TypeDescriptor.of(DateTime.class));
    DateTime lastPoint = DateTime.now();
    // At least 10ms in the past, or more.
    DateTime firstPoint = lastPoint.minusMillis(10 + new Random().nextInt(Integer.MAX_VALUE));
    List<KV<DateTime, DateTime>> ranges =
        Lists.newArrayList(helper.calculateRanges(firstPoint, lastPoint, 10L));
    // DateTime ranges are able to work out 10-11 ranges because they split in miliseconds which is
    // very small granularity.
    assertThat(Double.valueOf(ranges.size()), closeTo(10, 1));
  }