### Question:
JavaMailJMSStatistics extends NotificationBroadcasterSupport implements JavaMailJMSStatisticsLocal, DynamicMBean { private void reset() { startDate = new Date(); lastFailMessage = null; lastSuccessMessage = null; successCounter.set(0); failureCounter.set(0); }  @PostConstruct void registerInJMX(); @PreDestroy void unregisterFromJMX(); void onSuccess(MimeMessage mimeMessage, Address[] addresses); void onFailure(MimeMessage mimeMessage, Address[] addresses, Exception ex); @Override AttributeList getAttributes(String[] attributeNames); @Override Object getAttribute(String attribute); @Override void setAttribute(Attribute attribute); @Override AttributeList setAttributes(AttributeList attributes); @Override Object invoke(String actionName, Object[] params, String[] signature); @Override MBeanInfo getMBeanInfo(); static final String NOTIFICATION_TYPE_SUCCESS; static final String JAVA_MAIL_SEND_FAILURE; static final ObjectName JMX_OBJECT_NAME; }### Answer:
@Test public void testReset() throws Exception { Date date = new Date(); Thread.sleep(2000); javaMailJMSStatistics.onSuccess(mimeMessage, addressesTo); javaMailJMSStatistics.invoke("reset", new Object[0], new String[0]); assertEquals(0L, getMbeanAttribute("countSuccessful")); Date d = (Date) getMbeanAttribute("statisticsCollectionStartDate"); assertTrue(d.after(date)); }