### Question:
DateFormatPartitioner extends FieldPartitioner<Long, String> { @Override public String apply(Long value) { return format.format(new Date(value)); } DateFormatPartitioner(String sourceName, String name, String format);  DateFormatPartitioner(String sourceName, String name, String format, int cardinality, TimeZone zone); String getPattern(); @Override String apply(Long value); @Override Predicate<String> project(Predicate<Long> predicate); @Override Predicate<String> projectStrict(Predicate<Long> predicate); @Override int compare(String o1, String o2); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testApply() { long time = 1384912178434L; DateFormatPartitioner yyyyMMdd_UTC = new DateFormatPartitioner( "sourceField", "day", "yyyy-MM-dd"); Assert.assertEquals("2013-11-20", yyyyMMdd_UTC.apply(time)); DateFormatPartitioner yyyyMMdd_PDT = new DateFormatPartitioner( "sourceField", "day", "yyyy-MM-dd", 1095, TimeZone.getTimeZone("PDT")); Assert.assertEquals("2013-11-20", yyyyMMdd_PDT.apply(time)); }