### Question:
AddressesTopicsFilter { public boolean matchBloom(Bloom blockBloom) { for (Bloom[] andBloom : filterBlooms) { boolean orMatches = false; for (Bloom orBloom : andBloom) { if (blockBloom.matches(orBloom)) { orMatches = true; break; } } if (!orMatches) { return false; } } return true; } AddressesTopicsFilter(UscAddress[] addresses, Topic[] topics); boolean matchBloom(Bloom blockBloom); boolean matchesExactly(LogInfo logInfo);  }### Answer:
@Test public void matchEmptyBloomWithAllFilter() { AddressesTopicsFilter filter = new AddressesTopicsFilter(new UscAddress[0], null); Assert.assertTrue(filter.matchBloom(new Bloom())); }
@Test public void noMatchEmptyBloomWithFilterWithAccount() { Account account = new AccountBuilder().name("account").build(); UscAddress address = account.getAddress(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new UscAddress[] { address }, null); Assert.assertFalse(filter.matchBloom(new Bloom())); }
@Test public void noMatchEmptyBloomWithFilterWithTopic() { Topic topic = createTopic(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new UscAddress[0], new Topic[] { topic }); Assert.assertFalse(filter.matchBloom(new Bloom())); }
@Test public void matchAllBloomWithFilterWithTopic() { Topic topic = createTopic(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new UscAddress[0], new Topic[] { topic }); Assert.assertTrue(filter.matchBloom(getAllBloom())); }
@Test public void matchAllBloomWithFilterWithAccount() { Account account = new AccountBuilder().name("account").build(); UscAddress address = account.getAddress(); AddressesTopicsFilter filter = new AddressesTopicsFilter(new UscAddress[] { address }, null); Assert.assertTrue(filter.matchBloom(getAllBloom())); }