question: public void test_applyLocalizedPatternLjava_lang_String ( ) { DecimalFormat format = new DecimalFormat ( ) ; try { format . applyLocalizedPattern ( "#.#" ) ; assertEquals ( "Wrong pattern 1" , "#0.#" , format . toLocalizedPattern ( ) ) ; format . applyLocalizedPattern ( "#." ) ; assertEquals ( "Wrong pattern 2" , "#0." , format . toLocalizedPattern ( ) ) ; format . applyLocalizedPattern ( "#" ) ; assertEquals ( "Wrong pattern 3" , "#" , format . toLocalizedPattern ( ) ) ; format . applyLocalizedPattern ( ".#" ) ; assertEquals ( "Wrong pattern 4" , "#.0" , format . toLocalizedPattern ( ) ) ; try { format . applyLocalizedPattern ( "'#,#:#0.0#;(#)" ) ; fail ( "Expected IllegalArgumentException was not thrown" ) ; } catch ( IllegalArgumentException e ) { } try { format . applyLocalizedPattern ( ( String ) null ) ; fail ( "Expected NullPointerException was not thrown" ) ; } catch ( NullPointerException e ) { } } catch ( Exception e ) { fail ( "Unexpected exception " + e . toString ( ) ) ; } }
target:  Case 1: Try to apply correct variants of pattern. Case 2: Try to apply malformed patten. Case 3: Try to apply null pattern.