### Question:
DetachedRelationshipDescriptionImpl extends BaseRelationshipDescription<DetachedPropertiesDescription> implements DetachedRelationshipDescription { @Override public DetachedRelationshipDescription with(String propertyKey, Predicate predicate) { return new DetachedRelationshipDescriptionImpl(getType(), getDirection(), getPropertiesDescription().with(propertyKey, predicate)); } DetachedRelationshipDescriptionImpl(String relationshipType, Direction direction, DetachedPropertiesDescription propertiesDescription); @Override DetachedRelationshipDescription with(String propertyKey, Predicate predicate); @Override String toString();  }### Answer:
@Test public void shouldCorrectlyJudgeMoreGeneral() { assertTrue(literal("TEST", OUTGOING).isMoreGeneralThan(literal("TEST", OUTGOING))); assertFalse(literal("TEST2", OUTGOING).isMoreGeneralThan(literal("TEST", OUTGOING))); assertTrue(literal("TEST", BOTH).isMoreGeneralThan(literal("TEST", OUTGOING))); assertTrue(literal("TEST", OUTGOING).isMoreGeneralThan(literal("TEST", BOTH))); assertFalse(literal("TEST", OUTGOING).isMoreGeneralThan(literal("TEST", INCOMING))); assertFalse(literal("TEST", INCOMING).isMoreGeneralThan(literal("TEST", OUTGOING))); assertTrue(literal("TEST", OUTGOING).with("k1", equalTo("v1")).isMoreGeneralThan(literal("TEST", OUTGOING).with("k1", equalTo("v1")))); assertFalse(literal("TEST2", OUTGOING).with("k1", equalTo("v1")).isMoreGeneralThan(literal("TEST", OUTGOING).with("k1", equalTo("v1")))); }
@Test public void shouldCorrectlyJudgeMoreSpecific() { assertTrue(literal("TEST", OUTGOING).isMoreSpecificThan(literal("TEST", OUTGOING))); assertFalse(literal("TEST2", OUTGOING).isMoreSpecificThan(literal("TEST", OUTGOING))); assertTrue(literal("TEST", BOTH).isMoreSpecificThan(literal("TEST", OUTGOING))); assertTrue(literal("TEST", OUTGOING).isMoreSpecificThan(literal("TEST", BOTH))); assertFalse(literal("TEST", OUTGOING).isMoreSpecificThan(literal("TEST", INCOMING))); assertFalse(literal("TEST", INCOMING).isMoreSpecificThan(literal("TEST", OUTGOING))); assertTrue(literal("TEST", OUTGOING).with("k1", equalTo("v1")).isMoreSpecificThan(literal("TEST", OUTGOING).with("k1", equalTo("v1")))); assertFalse(literal("TEST2", OUTGOING).with("k1", equalTo("v1")).isMoreSpecificThan(literal("TEST", OUTGOING).with("k1", equalTo("v1")))); }
@Test public void shouldCorrectlyJudgeMutex() { assertFalse(literal("TEST", OUTGOING).isMutuallyExclusive(literal("TEST", OUTGOING))); assertTrue(literal("TEST2", OUTGOING).isMutuallyExclusive(literal("TEST", OUTGOING))); assertFalse(literal("TEST", BOTH).isMutuallyExclusive(literal("TEST", OUTGOING))); assertFalse(literal("TEST", OUTGOING).isMutuallyExclusive(literal("TEST", BOTH))); assertTrue(literal("TEST", OUTGOING).isMutuallyExclusive(literal("TEST", INCOMING))); assertTrue(literal("TEST", INCOMING).isMutuallyExclusive(literal("TEST", OUTGOING))); assertFalse(literal("TEST", OUTGOING).with("k1", equalTo("v1")).isMutuallyExclusive(literal("TEST", OUTGOING).with("k1", equalTo("v1")))); assertTrue(literal("TEST2", OUTGOING).with("k1", equalTo("v1")).isMutuallyExclusive(literal("TEST", OUTGOING).with("k1", equalTo("v1")))); }