### Question:
SimpleTimestampFormat extends SimpleDateFormat { @Override public void applyLocalizedPattern( String pattern ) { DateFormatSymbols formatSymbols = super.getDateFormatSymbols(); init( pattern, formatSymbols, true ); } SimpleTimestampFormat( String pattern );  SimpleTimestampFormat( String pattern, Locale locale );  SimpleTimestampFormat( String pattern, DateFormatSymbols formatSymbols ); @Override void setDateFormatSymbols( DateFormatSymbols newFormatSymbols ); @Override StringBuffer format( Date timestamp, StringBuffer toAppendTo, FieldPosition pos ); @Override AttributedCharacterIterator formatToCharacterIterator( Object obj ); @Override Date parse( String text, ParsePosition pos ); @Override String toPattern(); @Override String toLocalizedPattern(); @Override void applyPattern( String pattern ); @Override void applyLocalizedPattern( String pattern ); @Override Date parse( String source ); @Override Object parseObject( String source, ParsePosition pos ); static final String DEFAULT_TIMESTAMP_FORMAT; }### Answer:
@Test public void testApplyLocalizedPattern() throws Exception { Locale.setDefault( Locale.Category.FORMAT, Locale.US ); SimpleTimestampFormat stf = new SimpleTimestampFormat( new SimpleDateFormat().toPattern() ); for ( Locale locale : locales ) { Locale.setDefault( Locale.Category.FORMAT, locale ); tdb = ResourceBundle.getBundle( "org/pentaho/di/core/row/value/timestamp/messages/testdates", locale ); stf.applyLocalizedPattern( tdb.getString( "PATTERN.LOCALE.DEFAULT" ) ); assertEquals( locale.toLanguageTag(), tdb.getString( "PATTERN.LOCALE.DEFAULT" ), stf.toLocalizedPattern() ); checkFormat( "LOCALE.DEFAULT", stf ); } }
@Test public void testApplyLocalizedPattern() throws Exception { Locale.setDefault( Locale.Category.FORMAT, Locale.US ); SimpleTimestampFormat stf = new SimpleTimestampFormat( new SimpleDateFormat().toPattern() ); for ( Locale locale : locales ) { Locale.setDefault( Locale.Category.FORMAT, locale ); tdb = ResourceBundle.getBundle( "org/apache/hop/core/row/value/timestamp/messages/testdates", locale ); stf.applyLocalizedPattern( tdb.getString( "PATTERN.LOCALE.DEFAULT" ) ); assertEquals( locale.toLanguageTag(), tdb.getString( "PATTERN.LOCALE.DEFAULT" ), stf.toLocalizedPattern() ); checkFormat( "LOCALE.DEFAULT", stf ); } }