If extends GenericInput<I> implements InputOutput<I, O>, Operations<Operation> { @Override @JsonIgnore public Collection<Operation> getOperations() { final List<Operation> ops = new LinkedList<>(); if (null == conditional) { ops.add(new OperationChain()); } else { ops.add(OperationChain.wrap(conditional.getTransform())); } ops.add(OperationChain.wrap(then)); ops.add(OperationChain.wrap(otherwise)); return ops; }  @Override TypeReference<O> getOutputTypeReference(); @Override If<I, O> shallowClone(); @Override Map<String, String> getOptions(); @Override void setOptions(final Map<String, String> options); @Override @JsonIgnore Collection<Operation> getOperations(); @Override void updateOperations(final Collection<Operation> operations); Boolean getCondition(); void setCondition(final Boolean condition); Operation getThen(); void setThen(final Operation then); Operation getOtherwise(); void setOtherwise(final Operation otherwise); Conditional getConditional(); void setConditional(final Conditional conditional); @Override boolean equals(final Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void shouldGetOperations() { final GetElements getElements = new GetElements.Builder() .input(new EntitySeed("A")) .build(); final OperationChain opChain = new OperationChain.Builder() .first(new GetAllElements()) .then(new Limit<>(3)) .build(); final If<Object, Object> ifOp = new If.Builder<>() .condition(true) .then(getElements) .otherwise(opChain) .build(); final Collection<Operation> expectedOps = Lists.newArrayList(new OperationChain<>(), OperationChain.wrap(getElements), opChain); final Collection<Operation> result = ifOp.getOperations(); assertEquals(expectedOps, result); }