### Question:
BehaveMessage { public String getString(String key, Object... params) { if (params == null || params.length == 0) { return getString(key); } else { return MessageFormat.format(getString(key), params); } } BehaveMessage(String baseName);  BehaveMessage(String baseName, Locale locale); String getString(String key, Object... params); String getString(String key);  }### Answer:
@Test public void testGetStringByLocale() { System.setProperty("behave.message.locale", "pt"); BehaveMessage message = new BehaveMessage("demoiselle-behave-core-bundle"); assertEquals("message-exception-001-pt", message.getString("exception-001")); System.setProperty("behave.message.locale", "en"); message = new BehaveMessage("demoiselle-behave-core-bundle"); assertEquals("message-exception-001-en", message.getString("exception-001")); }
@Test public void testGetStringParans() { System.setProperty("behave.message.locale", "pt"); BehaveMessage message = new BehaveMessage("demoiselle-behave-core-bundle"); assertEquals("message pt: [demoiselle behave]", message.getString("message-param", "demoiselle", "behave")); System.setProperty("behave.message.locale", "en"); message = new BehaveMessage("demoiselle-behave-core-bundle"); assertEquals("message en: [demoiselle behave]", message.getString("message-param", "demoiselle", "behave")); }
@Test public void testGetStringNotFound() { BehaveMessage message = new BehaveMessage("demoiselle-behave-core-bundle"); assertEquals("??{mykey}??", message.getString("mykey")); }