### Question:
ResultComposer { public static <T, R> Result compose(T value, Collection<Result<R>>... results) { List<MarshallingMessage> messages = Stream.of(results).flatMap(Collection::stream) .map(Result::messages) .flatMap(List::stream) .collect(Collectors.toList()); return Result.success(value, messages.stream().toArray(MarshallingMessage[]::new)); }  static Result compose(T value, Collection<Result<R>>... results); static Result compose(T value, Result... result);  }### Answer:
@Test public void compose() { final Result result = ResultComposer.compose(value, result1, result2, result3); assertResult(result); }
@Test public void composeList() { final Result result = ResultComposer.compose(value, Arrays.asList(result1, result2, result3)); assertResult(result); }