@Test
public void testPlainRegistration() throws Exception {

    MBeanHolder mbh = new MBeanHolder(new Object(), new ObjectName("foo:bar=123"));
    Map<?,?> registrations = (Map<?,?>) getPrivateField(mbh, "registrations");
    Logger ml = Mockito.mock(Logger.class);
    setPrivateField(mbh, "log", ml);
    MBeanServer ms = mockMBeanServer();
    assertEquals(0, registrations.size());
    mbh.register(ms, new String [] {});
    assertEquals(1, registrations.size());
    assertEquals(new ObjectName("foo:bar=123"), registrations.get(ms));
    Mockito.verify(ml, Mockito.never()).error(Mockito.anyString(), Mockito.isA(Throwable.class));
}