### Question:
Invocation extends Expression implements HasExpression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getNotNullHasTypeRefs(getExpression())); hasTypeRefs.addAll(getFlatHasTypeRefs(getBinding())); return hasTypeRefs; } Invocation();  Invocation(final Id id,
                      final Description description,
                      final QName typeRef,
                      final Expression expression,
                      final List<Binding> binding); @Override Invocation copy(); @Override Expression getExpression(); @Override void setExpression(final Expression value); @Override DMNModelInstrumentedBase asDMNModelInstrumentedBase(); List<Binding> getBinding(); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testGetHasTypeRefs() { final Expression expression = mock(Expression.class); final Binding binding1 = mock(Binding.class); final Binding binding2 = mock(Binding.class); final List<Binding> binding = asList(binding1, binding2); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef3 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef4 = mock(HasTypeRef.class); doReturn(expression).when(invocation).getExpression(); doReturn(binding).when(invocation).getBinding(); when(expression.getHasTypeRefs()).thenReturn(asList(hasTypeRef1, hasTypeRef2)); when(binding1.getHasTypeRefs()).thenReturn(asList(hasTypeRef3)); when(binding2.getHasTypeRefs()).thenReturn(asList(hasTypeRef4)); final List<HasTypeRef> actualHasTypeRefs = invocation.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = asList(invocation, hasTypeRef1, hasTypeRef2, hasTypeRef3, hasTypeRef4); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }