### Question:
OperationJoin { public OperationJoin setOperations(Operation... ops) { if (ops.length == 0) { throw new IllegalArgumentException("At least one operation to join expected"); } if (this.operationIterator != null) { throw new IllegalStateException(ERROR_MSG_OPERATIONS_ALREADY_SET); } for (Operation op : ops) { prepareOperation(op); } this.operationIterator = this.operations.values().iterator(); return this; } private  OperationJoin(); static OperationJoin create(); static OperationJoin create(Operation... ops); static OperationJoin create(Collection<Operation> ops); static OperationJoin create(Stream<Operation> ops); OperationJoin setOperations(Operation... ops); OperationJoin setOperations(Collection<Operation> ops); OperationJoin setOperations(Stream<Operation> ops); void sendWith(ServiceRequestSender sender, int batchSize); void sendWith(ServiceRequestSender sender); OperationJoin setCompletion(JoinedCompletionHandler joinedCompletion); boolean isEmpty(); Collection<Operation> getOperations(); Map<Long, Throwable> getFailures(); Operation getOperation(long id); static final String ERROR_MSG_BATCH_LIMIT_VIOLATED; static final String ERROR_MSG_INVALID_BATCH_SIZE; static final String ERROR_MSG_OPERATIONS_ALREADY_SET; }### Answer:
@Test public void testSetOperations() throws Throwable { OperationJoin operationJoin = OperationJoin.create(); Operation op1 = createServiceOperation(this.services.get(0)); Operation op2 = createServiceOperation(this.services.get(1)); Operation op3 = createServiceOperation(this.services.get(2)); host.testStart(1); operationJoin .setOperations(op1, op2, op3) .setCompletion((ops, exs) -> { if (exs != null) { host.failIteration(exs.values().iterator().next()); } else { host.completeIteration(); } }).sendWith(host); host.testWait(); }