Messages { public String get( String key ) { String result; try { result = this.bundle.getString( key ); } catch( MissingResourceException e ) { result = OOPS + key + '!'; } return result; } Messages();  Messages( String locale ); String get( String key ); static final String OOPS; }
@Test public void testUnknownKey() { Messages messages = new Messages(); Assert.assertNotNull( messages.get( "unknown.key" )); }