LookupResult { boolean allPresent() { for (Integer flags : templates.values()) { if (flags != ALL_PRESENT) { return false; } } return true; } LookupResult(Set<AddressTemplate> templates); @Override String toString();  }
@Test public void allPresent() { LookupResult localLookupResult = new LookupResult(Sets.newHashSet( AddressTemplate.of("one"), AddressTemplate.of("two"), AddressTemplate.of("three"))); localLookupResult.markMetadataPresent(AddressTemplate.of("one"), ALL_PRESENT); localLookupResult.markMetadataPresent(AddressTemplate.of("two"), RESOURCE_DESCRIPTION_PRESENT); localLookupResult.markMetadataPresent(AddressTemplate.of("three"), SECURITY_CONTEXT_PRESENT); assertFalse(localLookupResult.allPresent()); localLookupResult.markMetadataPresent(AddressTemplate.of("one"), ALL_PRESENT); localLookupResult.markMetadataPresent(AddressTemplate.of("two"), ALL_PRESENT); localLookupResult.markMetadataPresent(AddressTemplate.of("three"), ALL_PRESENT); assertTrue(localLookupResult.allPresent()); }