### Question:
XACMLSchemaFactory { public AdviceExpression resourceAttributeToAdviceExpression(ResourceAttribute resourceAttribute) throws EntitlementException { final String adviceId = XACMLConstants.JSON_RESOURCE_ATTRIBUTE_ADVICE_ID + ":" + resourceAttribute.getClass() .getName(); AdviceExpression result = new AdviceExpression(); AttributeValue attributeValue = factory.createAttributeValue(); attributeValue.setDataType(XACMLConstants.XS_STRING); attributeValue.getContent().add(resourceAttributeUtil.toJSON(resourceAttribute)); JAXBElement<AttributeValue> jaxbElement = factory.createAttributeValue(attributeValue); AttributeAssignmentExpression attributeAssignmentExpression = factory.createAttributeAssignmentExpression(); attributeAssignmentExpression.setExpression(jaxbElement); attributeAssignmentExpression.setAttributeId(adviceId + ":" + resourceAttribute.getPropertyName()); result.getAttributeAssignmentExpression().add(attributeAssignmentExpression); result.setAppliesTo(EffectType.PERMIT); result.setAdviceId(adviceId); return result; } XACMLSchemaFactory(); AdviceExpressions resourceAttributesToAdviceExpressions(Set<ResourceAttribute> resourceAttributes); AdviceExpression resourceAttributeToAdviceExpression(ResourceAttribute resourceAttribute); Set<ResourceAttribute> adviceExpressionsToResourceAttributes(AdviceExpressions adviceExpressions); ResourceAttribute adviceExpressionToResourceAttribute(AdviceExpression adviceExpression);  }### Answer:
@Test public void shouldEnsureAdviceIsForPermitEffect() throws Exception { StaticAttributes testAttribute = new StaticAttributes(); AdviceExpression result = xacmlSchemaFactory.resourceAttributeToAdviceExpression(testAttribute); assertThat(result).isNotNull(); assertThat(result.getAppliesTo()).isEqualTo(EffectType.PERMIT); }