TupleCombiner implements Cloneable<TupleCombiner> { public List<VarDef> getCombinedVars( FunctionInputDef inputDef) { assertApplicable( inputDef); List<VarDef> combinedVars = new ArrayList<VarDef>(); for( VarDefIterator varDefs = new VarDefIterator( inputDef); varDefs.hasNext(); ) { VarDef varDef = varDefs.next(); if( isEligible( varDef)) { combinedVars.add( varDef); } } if( combinedVars.size() < getTupleSize()) { throw new IllegalStateException ( "Can't return " + getTupleSize() + "-tuples for " + inputDef + ": only " + combinedVars.size() + " variables eligible for combination"); } return combinedVars; } TupleCombiner();  TupleCombiner( int tupleSize); void setTupleSize( int tupleSize); int getTupleSize(); String[] getIncluded(); TupleCombiner addIncludedVar( String varNamePattern); TupleCombiner removeIncludedVar( String varNamePattern); TupleCombiner removeAllIncludedVars(); String[] getExcluded(); TupleCombiner addExcludedVar( String varNamePattern); TupleCombiner removeExcludedVar( String varNamePattern); TupleCombiner removeAllExcludedVars(); Iterator<TupleRef> getOnceTuples(); TupleCombiner addOnceTuple( TupleRef tupleRef); TupleCombiner removeOnceTuple( TupleRef tupleRef); TupleCombiner removeAllOnceTuples(); Collection<Tuple> getTuples( FunctionInputDef inputDef); static Collection<Tuple> getTuples( List<VarDef> varDefs, int tupleSize); List<VarDef> getCombinedVars( FunctionInputDef inputDef); boolean isEligible( IVarDef varDef); String toString(); TupleCombiner cloneOf(); boolean equals( Object object); int hashCode();  }
@Test public void getCombinedVars_All() { SystemInputDef systemInputDef = getSystemInputDef(); FunctionInputDef functionInputDef = systemInputDef.getFunctionInputDef( "Make"); TupleCombiner combiner = new TupleCombiner(); List<VarDef> combined = combiner.getCombinedVars( functionInputDef); assertThat( "Combined vars", IteratorUtils.transformedIterator( combined.iterator(), VarDef::getPathName), visitsMembers( "Color.Hue", "Color.Lightness", "Color.Saturation", "Shape", "Size")); }