### Question:
Messages { public String getString(String key) { if (key==null) { return ""; } if (bundle==null) { return key; } try { return bundle.getString(key); } catch (MissingResourceException e) { return '!' + key + '!'; } } Messages(); String getString(String key);  }### Answer:
@Test public void messageTest() { Messages m = new Messages(); assertEquals("", m.getString(null)); assertEquals("!not-exist!", m.getString("not-exist")); assertEquals("Freeze Update", m.getString("GeneratorGui.GUI_TOGGLE_FREEZE")); }