private List<Property> filterProperties(Iterable<Property> properties, boolean includeHidden, Authorizations authorizations) { List<Property> filteredProperties = new ArrayList<>(); for (Property p : properties) { if (canRead(p.getVisibility(), authorizations) && (includeHidden || !p.isHidden(authorizations))) { filteredProperties.add(p); } } return filteredProperties; }
if (property.getKey().equals("key2")) { foundProp1Key2 = true; assertFalse("should not be hidden", property.isHidden(AUTHORIZATIONS_A_AND_B)); } else if (property.getKey().equals("key1")) { if (property.getVisibility().equals(VISIBILITY_A)) { foundProp1Key1VisA = true; assertFalse("should not be hidden", property.isHidden(AUTHORIZATIONS_A)); assertTrue("should be hidden", property.isHidden(AUTHORIZATIONS_A_AND_B)); } else if (property.getVisibility().equals(VISIBILITY_B)) { foundProp1Key1VisB = true; assertFalse("should not be hidden", property.isHidden(AUTHORIZATIONS_A_AND_B)); } else { throw new RuntimeException("Unexpected visibility " + property.getVisibility());
if (property.getKey().equals("key2")) { foundProp1Key2 = true; assertFalse("should not be hidden", property.isHidden(AUTHORIZATIONS_A_AND_B)); } else if (property.getKey().equals("key1")) { if (property.getVisibility().equals(VISIBILITY_A)) { foundProp1Key1VisA = true; assertFalse("should not be hidden", property.isHidden(AUTHORIZATIONS_A)); assertTrue("should be hidden", property.isHidden(AUTHORIZATIONS_A_AND_B)); } else if (property.getVisibility().equals(VISIBILITY_B)) { foundProp1Key1VisB = true; assertFalse("should not be hidden", property.isHidden(AUTHORIZATIONS_A_AND_B)); } else { throw new RuntimeException("Unexpected visibility " + property.getVisibility());