### Question:
NewRelationship { public static Builder between(Entity.ID sourceID, Entity.ID targetID) { return new Builder(sourceID,targetID); } private  NewRelationship(Entity.ID source, Entity.ID target); Entity.ID getSourceID(); Entity.ID getTargetID(); Relationship.Name getName(); Map<Attribute.Name, Object> getAttributes(); static Builder between(Entity.ID sourceID, Entity.ID targetID); static Builder between(Entity source, Entity target);  }### Answer:
@Test public void testInitWithNullInstanceName() { Entity.ID sourceId = Entity.ID.valueOf("test-source-id"); Entity.ID targetId = Entity.ID.valueOf("test-target-id"); Attribute.Name attributeName = Attribute.Name.valueOf("test-attribute-name"); try { NewRelationship relationship = NewRelationship.between(sourceId, targetId).withAttribute(attributeName) .value(true).build(); fail("Should have thrown an exception"); } catch (Exception e) { assertTrue(e instanceof IllegalArgumentException); } }
@Test public void testInitWithNullSourceId(){ Entity.ID targetId = Entity.ID.valueOf("test-target-id"); Relationship.Name relationshipName = Relationship.Name.valueOf("test-relationship"); Attribute.Name attributeName = Attribute.Name.valueOf("test-attribute-name"); try { NewRelationship relationship = NewRelationship.between(null, targetId).withLabel(relationshipName).withAttribute(attributeName) .value(true).build(); fail("Should have thrown an exception"); } catch (Exception e) { assertTrue(e instanceof IllegalArgumentException); } }
@Test public void testInitWithNullTargetId(){ Entity.ID sourceId = Entity.ID.valueOf("test-source-id"); Relationship.Name relationshipName = Relationship.Name.valueOf("test-relationship"); Attribute.Name attributeName = Attribute.Name.valueOf("test-attribute-name"); try { NewRelationship relationship = NewRelationship.between(sourceId, null).withLabel(relationshipName).withAttribute(attributeName) .value(true).build(); fail("Should have thrown an exception"); } catch (Exception e) { assertTrue(e instanceof IllegalArgumentException); } }
@Test public void testInitWithNullAttribute(){ Entity.ID sourceId = Entity.ID.valueOf("test-source-id"); Entity.ID targetId = Entity.ID.valueOf("test-target-id"); Relationship.Name relationshipName = Relationship.Name.valueOf("test-relationship"); try { NewRelationship relationship = NewRelationship.between(sourceId, targetId).withLabel(relationshipName).withAttribute(null) .value(true).build(); fail("Should have thrown an exception"); } catch (Exception e) { assertTrue(e instanceof IllegalArgumentException); } }