OperationChain implements Output<OUT>,
        Operations<Operation> { @Override public void close() throws IOException { for (final Operation operation : operations) { CloseableUtil.close(operation); } } OperationChain();  OperationChain(final Operation operation);  OperationChain(final Output<OUT> operation);  OperationChain(final Operation... operations);  OperationChain(final List<Operation> operations);  OperationChain(final List<Operation> operations, final boolean flatten); static OperationChain<?> wrap(final Operation operation); static OperationChain<O> wrap(final Output<O> operation); @JsonIgnore @Override TypeReference<OUT> getOutputTypeReference(); @Override @JsonIgnore List<Operation> getOperations(); OperationChain<OUT> shallowClone(); @Override Map<String, String> getOptions(); @Override void setOptions(final Map<String, String> options); @Override String toString(); String toOverviewString(); @Override void close(); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void shouldCloseAllOperationInputs() throws IOException { final Operation[] operations = { mock(Operation.class), mock(Input.class), mock(Input.class), mock(MultiInput.class), mock(Input.class) }; final OperationChain opChain = new OperationChain(Arrays.asList(operations)); opChain.close(); for (final Operation operation : operations) { verify(operation).close(); } }