@Test public void testGetFlatHasTypeRefsFromExpressions() { final Expression expression1 = mock(Expression.class); final Expression expression2 = mock(Expression.class); final DMNModelInstrumentedBase parent = mock(DMNModelInstrumentedBase.class); final HasExpression hasExpression1 = HasExpression.wrap(parent, expression1); final HasExpression hasExpression2 = HasExpression.wrap(parent, expression2); final List<HasExpression> hasExpressions = asList(hasExpression1, hasExpression2); 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 List<HasTypeRef> typeRefList1 = asList(hasTypeRef1, hasTypeRef2); final List<HasTypeRef> typeRefList2 = asList(hasTypeRef3, hasTypeRef4); when(expression1.getHasTypeRefs()).thenReturn(typeRefList1); when(expression2.getHasTypeRefs()).thenReturn(typeRefList2); final List<HasTypeRef> actual = HasTypeRefHelper.getFlatHasTypeRefsFromExpressions(hasExpressions); final List<HasTypeRef> expected = asList(hasTypeRef1, hasTypeRef2, hasTypeRef3, hasTypeRef4); assertEquals(expected, actual); }
public static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions) { return hasTypeRefListExpressions .stream() .map(HasExpression::getExpression) .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions) { return hasTypeRefListExpressions .stream() .map(HasExpression::getExpression) .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); } }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions) { return hasTypeRefListExpressions .stream() .map(HasExpression::getExpression) .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); }  }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions) { return hasTypeRefListExpressions .stream() .map(HasExpression::getExpression) .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); }  static List<HasTypeRef> getNotNullHasTypeRefs(final HasTypeRef hasTypeRef); static List<HasTypeRef> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList); static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions); }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions) { return hasTypeRefListExpressions .stream() .map(HasExpression::getExpression) .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); }  static List<HasTypeRef> getNotNullHasTypeRefs(final HasTypeRef hasTypeRef); static List<HasTypeRef> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList); static List<HasTypeRef> getFlatHasTypeRefsFromExpressions(final List<? extends HasExpression> hasTypeRefListExpressions);  }