### Question:
StandardJmxSupport implements JmxSupport { @Override public void unregister(String objectName) { try { this.mBeanServer.unregisterMBean(new ObjectName(objectName)); } catch (JMException e) { throw new IllegalArgumentException(e); } } StandardJmxSupport();   StandardJmxSupport(MBeanServer mBeanServer); @Override void register(String objectName, Object instance); @Override void unregister(String objectName);  }### Answer:
@Test public void unregister() throws JMException { this.jmxSupport.unregister("domain:key=value"); verify(this.mBeanServer).unregisterMBean(new ObjectName("domain:key=value")); }
@Test(expected = IllegalArgumentException.class) public void unregisterJMException() throws JMException { doThrow(new InstanceNotFoundException()).when(this.mBeanServer).unregisterMBean(any(ObjectName.class)); this.jmxSupport.unregister("domain:key=value"); }