### Question:
DependencyRelation { public GrammaticalRelationTag getGrammaticalRelationTag() { return grammaticalRelationTag; } DependencyRelation(GrammaticalRelationTag grammaticalRelationTag, boolean isDependent,
			Span partner); GrammaticalRelationTag getGrammaticalRelationTag(); boolean isDependent(); Span getPartner(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testSimpleGrammaticalRelationInit() { GrammaticalRelationTag gramRelationTag = new GrammaticalRelationTag( "agent", GrammaticalRelation.Agent); DependencyRelation depRelation = new DependencyRelation(gramRelationTag, false, at.addToken(0, 0)); Assert.assertEquals("agent", depRelation.getGrammaticalRelationTag().getTag()); GrammaticalRelation relation = depRelation.getGrammaticalRelationTag().getGrammaticalRelation(); Assert.assertEquals(GrammaticalRelation.Agent, relation); Assert.assertEquals(null, relation.getParent()); Assert.assertEquals(GrammaticalRelationCategory.Argument, relation.getCategory()); }
@Test public void testGrammaticalRelationWithHierarchyInit() { GrammaticalRelationTag gramRelationTag = new GrammaticalRelationTag( "abbrev", GrammaticalRelation.AbbreviationModifier); DependencyRelation depRelation = new DependencyRelation(gramRelationTag, false, at.addToken(0, 0)); Assert.assertEquals("abbrev", depRelation.getGrammaticalRelationTag().getTag()); GrammaticalRelation relation = depRelation.getGrammaticalRelationTag().getGrammaticalRelation(); Assert.assertEquals(GrammaticalRelation.AbbreviationModifier, relation); Assert.assertEquals(GrammaticalRelation.Modifier, relation.getParent()); Set<GrammaticalRelation> expectedHierarcy = EnumSet.of(GrammaticalRelation.Dependent, GrammaticalRelation.Modifier, GrammaticalRelation.AbbreviationModifier); Set<GrammaticalRelation> hierarchy = relation.hierarchy(); Assert.assertEquals(expectedHierarcy, hierarchy); }