SieveAddressBuilder { public void reset() { addresses.clear(); } SieveAddressBuilder(); void reset(); void addAddresses(String addressList); Address[] getAddresses();  }
@Test public void testReset() throws Exception { Assert.assertNotNull(builder.getAddresses()); builder.addAddresses(COYOTE_ADDRESS); Address[] addresses = builder.getAddresses(); Assert.assertNotNull(addresses); Assert.assertEquals(1, addresses.length); Assert.assertEquals(COYOTE, addresses[0].getLocalPart()); Assert.assertEquals(DOMAIN, addresses[0].getDomain()); addresses = builder.getAddresses(); Assert.assertNotNull(addresses); Assert.assertEquals(1, addresses.length); Assert.assertEquals(COYOTE, addresses[0].getLocalPart()); Assert.assertEquals(DOMAIN, addresses[0].getDomain()); builder.reset(); addresses = builder.getAddresses(); Assert.assertNotNull(addresses); Assert.assertEquals(0, addresses.length); builder.addAddresses(COYOTE_ADDRESS); addresses = builder.getAddresses(); Assert.assertNotNull(addresses); Assert.assertEquals(1, addresses.length); Assert.assertEquals(COYOTE, addresses[0].getLocalPart()); Assert.assertEquals(DOMAIN, addresses[0].getDomain()); }