@Test public void testGetTypeRefOfExpression() { when(hasExpression.asDMNModelInstrumentedBase()).thenReturn(mock(DMNModelInstrumentedBase.class)); when(expression.getTypeRef()).thenReturn(TYPE_REF); assertThat(TypeRefUtils.getTypeRefOfExpression(expression, hasExpression).getTypeRef()).isEqualTo(TYPE_REF); }
public static <E extends Expression> HasTypeRef getTypeRefOfExpression(final E expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression; final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }
TypeRefUtils { public static <E extends Expression> HasTypeRef getTypeRefOfExpression(final E expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression; final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; } }
TypeRefUtils { public static <E extends Expression> HasTypeRef getTypeRefOfExpression(final E expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression; final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }  }
TypeRefUtils { public static <E extends Expression> HasTypeRef getTypeRefOfExpression(final E expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression; final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }  static HasTypeRef getTypeRefOfExpression(final E expression,
                                                                           final HasExpression hasExpression); }
TypeRefUtils { public static <E extends Expression> HasTypeRef getTypeRefOfExpression(final E expression, final HasExpression hasExpression) { HasTypeRef hasTypeRef = expression; final DMNModelInstrumentedBase base = hasExpression.asDMNModelInstrumentedBase(); if (base instanceof HasVariable) { final HasVariable hasVariable = (HasVariable) base; hasTypeRef = hasVariable.getVariable(); } return hasTypeRef; }  static HasTypeRef getTypeRefOfExpression(final E expression,
                                                                           final HasExpression hasExpression);  }