@Test public void testGetFlatHasTypeRefs() { 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); final List<HasTypeRef> typeRefList1 = asList(hasTypeRef3, hasTypeRef4); final List<HasTypeRef> typeRefList2 = asList(hasTypeRef5, hasTypeRef6); final List<HasTypeRefs> hasTypeRefs = asList(hasTypeRef1, hasTypeRef2); when(hasTypeRef1.getHasTypeRefs()).thenReturn(typeRefList1); when(hasTypeRef2.getHasTypeRefs()).thenReturn(typeRefList2); final List<HasTypeRef> actual = HasTypeRefHelper.getFlatHasTypeRefs(hasTypeRefs); final List<HasTypeRef> expected = asList(hasTypeRef3, hasTypeRef4, hasTypeRef5, hasTypeRef6); assertEquals(expected, actual); }
public static List<HasTypeRef> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList) { return hasTypeRefList .stream() .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList) { return hasTypeRefList .stream() .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); } }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList) { return hasTypeRefList .stream() .flatMap(typeRefs -> typeRefs.getHasTypeRefs().stream()) .collect(Collectors.toList()); }  }
HasTypeRefHelper { public static List<HasTypeRef> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList) { return hasTypeRefList .stream() .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> getFlatHasTypeRefs(final List<? extends HasTypeRefs> hasTypeRefList) { return hasTypeRefList .stream() .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);  }