@Test(expected=JmxRegistrationException.class)
public void registerNameTwice() {

    final MockedJmxRegistry service;
    try {
        service = new MockedJmxRegistry();
        assertRegisteredServices(service);
        service.register(new GoodService("Alpha"));
    } catch (Throwable t) {
        throw new RuntimeException(t);
    }
    service.register(new GoodService("Alpha"));
}