### Question:
CombineResult { DeferAction<D> getDeferAction() { return action; } CombineResult(FuncList<NamedExpression<HasPromise<Object>>> hasPromises,
             Func1<FuncList<Result>, Result<D>>                 mergeFunc);   }### Answer:
@Test public void testMerge() { val logs = new ArrayList<String>(); val action1 = DeferAction.createNew().start(); val action2 = DeferAction.createNew().start(); val action3 = DeferAction.createNew().start(); val combiner = new CombineResult<>( listOf(action1, action2, action3), l -> Result.valueOf(l.toString())); val combine = combiner.getDeferAction() .onComplete(result -> { logs.add(result.toString()); }); logs.add("Done prepare"); logs.add("About to do one: " + action1.getPromise().getStatus()); action1.complete("One"); logs.add("About to do two: " + action2.getPromise().getStatus()); action2.complete("Two"); logs.add("About to do three: " + action3.getPromise().getStatus()); action3.complete("Three"); combine.abort(); logs.add(combine.getResult().toString()); assertEquals( "Done prepare\n" + "About to do one: PENDING\n" + "About to do two: PENDING\n" + "About to do three: PENDING\n" + "Result:{ Value: [Result:{ Value: One }, Result:{ Value: Two }, Result:{ Value: Three }] }\n" + "Result:{ Value: [Result:{ Value: One }, Result:{ Value: Two }, Result:{ Value: Three }] }", logs.stream().collect(joining("\n"))); }