@Test
public void testSetResourceBundle() {

    final DefaultErrorListener listener = new DefaultErrorListener();
    ResourceBundle originalBundle = listener.getResourceBundle();
    assertSame("same object returned twice", originalBundle, listener.getResourceBundle());
    ResourceBundle newBundle = ResourceBundle.getBundle(listener.getResourceBundleBaseName(),
            Locale.getDefault(), new URLClassLoader(new URL[0], getClass().getClassLoader()));
    assertNotSame("not same object as created externally", newBundle, listener.getResourceBundle());
    listener.setResourceBundle(newBundle);
    assertSame("same object as set", newBundle, listener.getResourceBundle());
    assertSame("same object as set, again", newBundle, listener.getResourceBundle());
}