### Question:
PathConversion { public static <T> String dirnameForValue(FieldPartitioner<?, T> field, T value) { return PART_JOIN.join(field.getName(), valueToString(field, value)); } PathConversion(Schema schema); StorageKey toKey(Path fromPath, StorageKey storage); Path fromKey(StorageKey key); T valueForDirname(FieldPartitioner<?, T> field, String name); static String dirnameForValue(FieldPartitioner<?, T> field, T value); static String valueToString(FieldPartitioner<?, T> field, T value); static T valueForDirname(FieldPartitioner<?, T> field, Schema schema, String name); static String dirnameToValueString(String name);  }### Answer:
@Test public void testDirnameMinWidth() { Assert.assertEquals("min=01", PathConversion.dirnameForValue( new MinuteFieldPartitioner("timestamp", "min"), 1)); Assert.assertEquals("hour=01", PathConversion.dirnameForValue( new HourFieldPartitioner("timestamp", "hour"), 1)); Assert.assertEquals("day=01", PathConversion.dirnameForValue( new DayOfMonthFieldPartitioner("timestamp", "day"), 1)); Assert.assertEquals("month=01", PathConversion.dirnameForValue( new MonthFieldPartitioner("timestamp", "month"), 1)); Assert.assertEquals("year=2013", PathConversion.dirnameForValue( new YearFieldPartitioner("timestamp", "year"), 2013)); }
@Test public void testUsesFieldName() { Assert.assertEquals("day_of_month_field", Iterables.getFirst(EQ.split(PathConversion.dirnameForValue( new DayOfMonthFieldPartitioner("day", "day_of_month_field"), 10)), null)); }