CompositeOperation implements Operation { public static Operation sequenceOf(@Nonnull Operation... operations) { return sequenceOf(Arrays.asList(operations)); } private  CompositeOperation(List<? extends Operation> operations); static Operation sequenceOf(@Nonnull Operation... operations); static Operation sequenceOf(@Nonnull List<? extends Operation> operations); @Override void execute(Connection connection, BinderConfiguration configuration); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void sequenceOfWorksWhenNop() throws SQLException { testNoArgOpWorks(CompositeOperation.sequenceOf()); testNoArgOpWorks(CompositeOperation.sequenceOf(Collections.<Operation>emptyList())); testNoArgOpWorks(Operations.sequenceOf()); testNoArgOpWorks(Operations.sequenceOf(Collections.<Operation>emptyList())); }
@Test public void sequenceOfWorksWhenSingleArg() throws SQLException { Operation a = mock(Operation.class); assertSame(a, CompositeOperation.sequenceOf(a)); assertSame(a, CompositeOperation.sequenceOf(Collections.singletonList(a))); assertSame(a, Operations.sequenceOf(a)); assertSame(a, Operations.sequenceOf(Collections.singletonList(a))); }
@Test public void sequenceOfWorksWhenSeveralArgs() throws SQLException { Operation a = mock(Operation.class); Operation b = mock(Operation.class); testSequenceOfWorksWhenMultipleArgs(CompositeOperation.sequenceOf(a, b), a, b); testSequenceOfWorksWhenMultipleArgs(CompositeOperation.sequenceOf(Arrays.asList(a, b)), a, b); testSequenceOfWorksWhenMultipleArgs(Operations.sequenceOf(a, b), a, b); testSequenceOfWorksWhenMultipleArgs(Operations.sequenceOf(Arrays.asList(a, b)), a, b); }