@Test public void testUnRegisterLegacy() throws Exception { registry.register(TESTING_REPORTED_BEAN, TESTING_OBJECT_NAME); registry.unregisterLegacy(ObjectName.getInstance("com.proofpoint.reporting", "name", "TestingObject")); assertEquals(registry.getReportedBeans(), ImmutableList.of()); }
void unregisterLegacy(ObjectName name) throws InstanceNotFoundException { ReportedBean remove = legacyReportedBeans.remove(name); if (remove == null) { throw new InstanceNotFoundException(name.getCanonicalName() + " not found"); } reportedBeans.remove(new Reference(remove)); }
ReportedBeanRegistry { void unregisterLegacy(ObjectName name) throws InstanceNotFoundException { ReportedBean remove = legacyReportedBeans.remove(name); if (remove == null) { throw new InstanceNotFoundException(name.getCanonicalName() + " not found"); } reportedBeans.remove(new Reference(remove)); } }
ReportedBeanRegistry { void unregisterLegacy(ObjectName name) throws InstanceNotFoundException { ReportedBean remove = legacyReportedBeans.remove(name); if (remove == null) { throw new InstanceNotFoundException(name.getCanonicalName() + " not found"); } reportedBeans.remove(new Reference(remove)); }  }
ReportedBeanRegistry { void unregisterLegacy(ObjectName name) throws InstanceNotFoundException { ReportedBean remove = legacyReportedBeans.remove(name); if (remove == null) { throw new InstanceNotFoundException(name.getCanonicalName() + " not found"); } reportedBeans.remove(new Reference(remove)); }   }
ReportedBeanRegistry { void unregisterLegacy(ObjectName name) throws InstanceNotFoundException { ReportedBean remove = legacyReportedBeans.remove(name); if (remove == null) { throw new InstanceNotFoundException(name.getCanonicalName() + " not found"); } reportedBeans.remove(new Reference(remove)); }    }