### Question:
Context extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getContextEntry())); return hasTypeRefs; } Context();  Context(final Id id,
                   final Description description,
                   final QName typeRef); @Override Context copy(); List<ContextEntry> getContextEntry(); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testGetHasTypeRefs() { final ContextEntry contextEntry1 = mock(ContextEntry.class); final ContextEntry contextEntry2 = mock(ContextEntry.class); final List<ContextEntry> contextEntry = asList(contextEntry1, contextEntry2); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); doReturn(contextEntry).when(context).getContextEntry(); when(contextEntry1.getHasTypeRefs()).thenReturn(asList(hasTypeRef1)); when(contextEntry2.getHasTypeRefs()).thenReturn(asList(hasTypeRef2)); final List<HasTypeRef> actualHasTypeRefs = context.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = asList(context, hasTypeRef1, hasTypeRef2); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }