Source:
<code>public void roundRobinAllocationTest() throws InjectionException { final int numExecutors = 4; final int numOperatorChains = 10; final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder(); <START> jcb.bindNamedParameter(NumExecutors.class, 4+""); <END> final Injector injector = Tang.Factory.getTang().newInjector(jcb.build()); final ExecutorListProvider executorListProvider = injector.getInstance(ExecutorListProvider.class); final DAG<OperatorChain> operatorChainDAG = new AdjacentListDAG<>(); final OperatorChainAllocator operatorChainAllocator = injector.getInstance(DefaultOperatorChainAllocatorImpl.class); OperatorChain src = injector.getInstance(OperatorChain.class); operatorChainDAG.addVertex(src); for (int i = 1; i < numOperatorChains; i++) { final Injector newInjector = Tang.Factory.getTang().newInjector(); final OperatorChain dest = newInjector.getInstance(OperatorChain.class); operatorChainDAG.addVertex(dest); operatorChainDAG.addEdge(src, dest); src = dest; } operatorChainAllocator.allocate(operatorChainDAG); final Iterator<OperatorChain> operatorChainIterator = GraphUtils.topologicalSort(operatorChainDAG); final List<MistExecutor> executors = executorListProvider.getExecutors(); int index = 0; while (operatorChainIterator.hasNext()) { final OperatorChain operatorChain = operatorChainIterator.next(); Assert.assertEquals("Assigned executor should be " + executors.get(index).getIdentifier(), executors.get(index), operatorChain.getExecutor()); index = (index + 1) % numExecutors; } }</code><technical_language>I 4+"" is a good practice :). Integer.toString() instead</technical_language>

Target:
public void roundRobinAllocationTest() throws InjectionException { final int numExecutors = 4; final int numOperatorChains = 10; final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder(); jcb.bindNamedParameter(NumExecutors.class, Integer.toString(4)); final Injector injector = Tang.Factory.getTang().newInjector(jcb.build()); final ExecutorListProvider executorListProvider = injector.getInstance(ExecutorListProvider.class); final DAG<OperatorChain> operatorChainDAG = new AdjacentListDAG<>(); final OperatorChainAllocator operatorChainAllocator = injector.getInstance(DefaultOperatorChainAllocatorImpl.class); OperatorChain src = injector.getInstance(OperatorChain.class); operatorChainDAG.addVertex(src); for (int i = 1; i < numOperatorChains; i++) { final Injector newInjector = Tang.Factory.getTang().newInjector(); final OperatorChain dest = newInjector.getInstance(OperatorChain.class); operatorChainDAG.addVertex(dest); operatorChainDAG.addEdge(src, dest); src = dest; } operatorChainAllocator.allocate(operatorChainDAG); final Iterator<OperatorChain> operatorChainIterator = GraphUtils.topologicalSort(operatorChainDAG); final List<MistExecutor> executors = executorListProvider.getExecutors(); int index = 0; while (operatorChainIterator.hasNext()) { final OperatorChain operatorChain = operatorChainIterator.next(); Assert.assertEquals("Assigned executor should be " + executors.get(index).getIdentifier(), executors.get(index), operatorChain.getExecutor()); index = (index + 1) % numExecutors; } }