### Question:
E2ERelationshipPersistence { public static CdmE2ERelationship fromData(final CdmCorpusContext ctx, final E2ERelationship dataObj) { final CdmE2ERelationship relationship = ctx.getCorpus().makeObject(CdmObjectType.E2ERelationshipDef); if (!StringUtils.isNullOrTrimEmpty(dataObj.getName())) { relationship.setName(dataObj.getName()); } relationship.setFromEntity(dataObj.getFromEntity()); relationship.setFromEntityAttribute(dataObj.getFromEntityAttribute()); relationship.setToEntity(dataObj.getToEntity()); relationship.setToEntityAttribute(dataObj.getToEntityAttribute()); return relationship; }  static CdmE2ERelationship fromData(final CdmCorpusContext ctx, final E2ERelationship dataObj); static E2ERelationship toData(final CdmE2ERelationship instance);  }### Answer:
@Test public void fromDataTest() { E2ERelationship dataObj = new E2ERelationship(); dataObj.setToEntity("TO_ENTITY"); dataObj.setToEntityAttribute("TO_ENTITY_ATTRIBUTE"); dataObj.setFromEntity("FROM_ENTITY"); dataObj.setFromEntityAttribute("FROM_ENTITY_ATTRIBUTE"); CdmE2ERelationship result = E2ERelationshipPersistence.fromData(new CdmCorpusDefinition().getCtx(), dataObj); AssertJUnit.assertEquals(result.getToEntity(), "TO_ENTITY"); AssertJUnit.assertEquals(result.getToEntityAttribute(), "TO_ENTITY_ATTRIBUTE"); AssertJUnit.assertEquals(result.getFromEntity(), "FROM_ENTITY"); AssertJUnit.assertEquals(result.getFromEntityAttribute(), "FROM_ENTITY_ATTRIBUTE"); }