### Question:
EdmAssociationImplProv extends EdmNamedImplProv implements EdmAssociation, EdmAnnotatable { @Override public EdmReferentialConstraint getReferentialConstraint() throws EdmException { if (referentialConstraint == null) { ReferentialConstraint refConstraint = association.getReferentialConstraint(); if (refConstraint != null) { referentialConstraint = new EdmReferentialConstraintImplProv(refConstraint); } } return referentialConstraint; } EdmAssociationImplProv(final EdmImplProv edm, final Association association, final String namespace); @Override String getNamespace(); @Override EdmTypeKind getKind(); @Override EdmAssociationEnd getEnd(final String role); @Override EdmAnnotations getAnnotations(); EdmMultiplicity getEndMultiplicity(final String role); @Override EdmAssociationEnd getEnd1(); @Override EdmAssociationEnd getEnd2(); @Override EdmReferentialConstraint getReferentialConstraint();  }### Answer:
@Test public void testReferentialConstraint() throws EdmException { assertEquals("end1Role", associationProv.getReferentialConstraint().getDependent().getRole()); assertEquals("end2Role", associationProv.getReferentialConstraint().getPrincipal().getRole()); }
@Test public void testReferentialConstraintNull() throws EdmException { Association association = new Association().setName("association"); EdmAssociation edmAssociation = new EdmAssociationImplProv(null, association, "ns"); assertNull(edmAssociation.getReferentialConstraint()); }