@Test public void testCreateSimpleFormatSupplier() { final String format = DateFormatSupplier.HUMAN_READABLE_FORMAT; DateFormatSupplier supplierA = DateFormatSupplier.createSimpleFormatSupplier(format); DateFormatSupplier supplierB = DateFormatSupplier.createSimpleFormatSupplier(format); assertSuppliersIndependent(supplierA, supplierB); supplierA.setTimeZone(TimeZone.getTimeZone("UTC")); final DateFormat dfA = supplierA.get(); supplierB.setTimeZone(TimeZone.getTimeZone("EST")); final DateFormat dfB = supplierB.get(); final String resultA = dfA.format(new Date(0)); assertEquals("1970/01/01 00:00:00.000", resultA); final String resultB = dfB.format(new Date(0)); assertEquals("1969/12/31 19:00:00.000", resultB); assertTrue(!resultA.equals(resultB)); }
public static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat) { return new DateFormatSupplier() { @Override protected SimpleDateFormat initialValue() { return new SimpleDateFormat(dateFormat); } }; }
DateFormatSupplier extends ThreadLocal<DateFormat> implements Supplier<DateFormat> { public static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat) { return new DateFormatSupplier() { @Override protected SimpleDateFormat initialValue() { return new SimpleDateFormat(dateFormat); } }; } }
DateFormatSupplier extends ThreadLocal<DateFormat> implements Supplier<DateFormat> { public static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat) { return new DateFormatSupplier() { @Override protected SimpleDateFormat initialValue() { return new SimpleDateFormat(dateFormat); } }; } DateFormatSupplier();  DateFormatSupplier(TimeZone timeZone); }
DateFormatSupplier extends ThreadLocal<DateFormat> implements Supplier<DateFormat> { public static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat) { return new DateFormatSupplier() { @Override protected SimpleDateFormat initialValue() { return new SimpleDateFormat(dateFormat); } }; } DateFormatSupplier();  DateFormatSupplier(TimeZone timeZone); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); @Override DateFormat get(); static DateFormatSupplier createDefaultFormatSupplier(); static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat); static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat,
      final TimeZone timeZone); }
DateFormatSupplier extends ThreadLocal<DateFormat> implements Supplier<DateFormat> { public static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat) { return new DateFormatSupplier() { @Override protected SimpleDateFormat initialValue() { return new SimpleDateFormat(dateFormat); } }; } DateFormatSupplier();  DateFormatSupplier(TimeZone timeZone); TimeZone getTimeZone(); void setTimeZone(TimeZone timeZone); @Override DateFormat get(); static DateFormatSupplier createDefaultFormatSupplier(); static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat); static DateFormatSupplier createSimpleFormatSupplier(final String dateFormat,
      final TimeZone timeZone); static final String HUMAN_READABLE_FORMAT; }