### Question:
SolarisEntries { public static Iterator<SolarisEntry> getAllAccounts(Set<NativeAttribute> attrsToGet, SolarisConnection conn) { if (conn.isNis() || attrsToGet.contains(NativeAttribute.PROFILES) || attrsToGet.contains(NativeAttribute.AUTHS) || attrsToGet.contains(NativeAttribute.ROLES)) { return new AccountIterator(attrsToGet, conn); } return new BlockAccountIterator(attrsToGet, conn); } private  SolarisEntries(); static Iterator<SolarisEntry> getAllAccounts(Set<NativeAttribute> attrsToGet,
            SolarisConnection conn); static Iterator<SolarisEntry> getAllGroups(Set<NativeAttribute> attrsToGet,
            SolarisConnection conn); static SolarisEntry getAccount(String name, Set<NativeAttribute> attrsToGet,
            SolarisConnection conn); static SolarisEntry getGroup(String groupName, Set<NativeAttribute> attrsToGet,
            SolarisConnection conn);  }### Answer:
@Test public void testGetAllAccounts() { final NativeAttribute profilesAttr = NativeAttribute.PROFILES; final NativeAttribute rolesAttr = NativeAttribute.ROLES; Iterator<SolarisEntry> result = SolarisEntries.getAllAccounts(EnumSet.of(profilesAttr, rolesAttr), getConnection()); while (result.hasNext()) { final SolarisEntry nextIt = result.next(); final Set<Attribute> attributeSet = nextIt.getAttributeSet(); boolean isProfiles = false; boolean isRoles = false; for (Attribute attribute : attributeSet) { if (!isProfiles) { isProfiles = profilesAttr.getName().equals(attribute.getName()); } if (!isRoles) { isRoles = rolesAttr.getName().equals(attribute.getName()); } if (isProfiles && isRoles) { break; } } final String basicMsg = "Entry: '%s' is missing attribute: '%s'"; String msg = String.format(basicMsg, nextIt.getName(), profilesAttr); if (!getConnection().isNis()) { assertTrue(isProfiles, msg); } msg = String.format(basicMsg, nextIt.getName(), rolesAttr); if (!getConnection().isNis()) { assertTrue(isRoles, msg); } } }