### Question:
DecisionTable extends Expression { @Override public List<HasTypeRef> getHasTypeRefs() { final List<HasTypeRef> hasTypeRefs = super.getHasTypeRefs(); hasTypeRefs.addAll(getFlatHasTypeRefs(getInput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getOutput())); hasTypeRefs.addAll(getFlatHasTypeRefs(getRule())); return hasTypeRefs; } DecisionTable();  DecisionTable(final Id id,
                         final Description description,
                         final QName typeRef,
                         final List<InputClause> input,
                         final List<OutputClause> output,
                         final List<DecisionRule> rule,
                         final HitPolicy hitPolicy,
                         final BuiltinAggregator aggregation,
                         final DecisionTableOrientation preferredOrientation,
                         final String outputLabel); @Override DecisionTable copy(); List<RuleAnnotationClause> getAnnotations(); List<InputClause> getInput(); List<OutputClause> getOutput(); List<DecisionRule> getRule(); HitPolicy getHitPolicy(); void setHitPolicy(final HitPolicy value); BuiltinAggregator getAggregation(); void setAggregation(final BuiltinAggregator value); DecisionTableOrientation getPreferredOrientation(); void setPreferredOrientation(final DecisionTableOrientation value); String getOutputLabel(); void setOutputLabel(final String value); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }### Answer:
@Test public void testGetHasTypeRefs() { final InputClause inputClauses1 = mock(InputClause.class); final InputClause inputClauses2 = mock(InputClause.class); final List<InputClause> inputClauses = asList(inputClauses1, inputClauses2); final OutputClause outputClauses1 = mock(OutputClause.class); final OutputClause outputClauses2 = mock(OutputClause.class); final List<OutputClause> outputClauses = asList(outputClauses1, outputClauses2); final DecisionRule decisionRules1 = mock(DecisionRule.class); final DecisionRule decisionRules2 = mock(DecisionRule.class); final List<DecisionRule> decisionRules = asList(decisionRules1, decisionRules2); final HasTypeRef hasTypeRef1 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef2 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef3 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef4 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef5 = mock(HasTypeRef.class); final HasTypeRef hasTypeRef6 = mock(HasTypeRef.class); doReturn(inputClauses).when(decisionTable).getInput(); doReturn(outputClauses).when(decisionTable).getOutput(); doReturn(decisionRules).when(decisionTable).getRule(); when(inputClauses1.getHasTypeRefs()).thenReturn(asList(hasTypeRef1)); when(inputClauses2.getHasTypeRefs()).thenReturn(asList(hasTypeRef2)); when(outputClauses1.getHasTypeRefs()).thenReturn(asList(hasTypeRef3)); when(outputClauses2.getHasTypeRefs()).thenReturn(asList(hasTypeRef4)); when(decisionRules1.getHasTypeRefs()).thenReturn(asList(hasTypeRef5)); when(decisionRules2.getHasTypeRefs()).thenReturn(asList(hasTypeRef6)); final List<HasTypeRef> actualHasTypeRefs = decisionTable.getHasTypeRefs(); final List<HasTypeRef> expectedHasTypeRefs = asList(decisionTable, hasTypeRef1, hasTypeRef2, hasTypeRef3, hasTypeRef4, hasTypeRef5, hasTypeRef6); assertEquals(expectedHasTypeRefs, actualHasTypeRefs); }