### Question:
TemporalFunction { public static int getDay(Type type, Block block, int position) { if (type.equals(DATE)) { return toIntExact(DATE.getLong(block, position)); } if (type.equals(TIMESTAMP_MILLIS)) { long days = floorDiv(TIMESTAMP_MILLIS.getLong(block, position), MICROSECONDS_PER_DAY); return toIntExact(days); } throw new IllegalArgumentException("Wrong type for temporal column: " + type); } private  TemporalFunction(); static int getDay(Type type, Block block, int position); static int getDayFromRange(ShardRange range);  }### Answer:
@Test public void testDateBlock() { BlockBuilder blockBuilder = DATE.createBlockBuilder(null, 2); DATE.writeLong(blockBuilder, 13); DATE.writeLong(blockBuilder, 42); Block block = blockBuilder.build(); assertEquals(TemporalFunction.getDay(DATE, block, 0), 13); assertEquals(TemporalFunction.getDay(DATE, block, 1), 42); }
@Test public void testTimestampBlock() { BlockBuilder blockBuilder = TIMESTAMP_MILLIS.createBlockBuilder(null, 4); TIMESTAMP_MILLIS.writeLong(blockBuilder, DATE_TIME.getMillis() * MICROSECONDS_PER_MILLISECOND); TIMESTAMP_MILLIS.writeLong(blockBuilder, (DATE_TIME.getMillis() + Duration.ofHours(23).toMillis()) * MICROSECONDS_PER_MILLISECOND); Block block = blockBuilder.build(); assertEquals(TemporalFunction.getDay(TIMESTAMP_MILLIS, block, 0), 1); assertEquals(TemporalFunction.getDay(TIMESTAMP_MILLIS, block, 1), 1); }