ExecutionTwoParamBuilderImpl extends AbstractExecutionBuilder<T> implements ExecutionTwoParamBuilder<T, P0, P1> { @Override public Execution<T> build(DependencyGraph graph) { requireNonNull(executeAction, "No execution has been specified."); final DependencyNode node0 = graph.get(param0); final Dependency dep0 = new DependencyImpl(node0, state0); final DependencyNode node1 = graph.get(param1); final Dependency dep1 = new DependencyImpl(node1, state1); return new AbstractExecution<T>( getComponent(), getState(), unmodifiableSet(dep0, dep1), MissingArgumentStrategy.THROW_EXCEPTION) { @Override public boolean invoke(T component, ClassMapper classMapper) { final P0 arg0 = classMapper.apply(param0); final P1 arg1 = classMapper.apply(param1); executeAction.accept(component, arg0, arg1); return true; } }; } ExecutionTwoParamBuilderImpl(
            Class<T> component, State state,
            Class<P0> param0, State state0,
            Class<P1> param1, State state1); @Override ExecutionThreeParamBuilder<T, P0, P1, P2> withState(
            State state2, Class<P2> param2); @Override ExecutionBuilder<T> withExecute(TriConsumer<T, P0, P1> executeAction); @Override Execution<T> build(DependencyGraph graph);  }
@Test void build() throws InvocationTargetException, IllegalAccessException { builder.withExecute((i, s, l) -> {}); when(dependencyGraph.get(String.class)).thenReturn(dependencyNode1); when(dependencyGraph.get(Long.class)).thenReturn(dependencyNode2); final Execution<Integer> e = builder.build(dependencyGraph); assertNotNull(e); final Execution.ClassMapper classMapper = new Execution.ClassMapper() { @Override @SuppressWarnings("unchecked") public <T> T apply(Class<T> type) { switch (type.getSimpleName()) { case "Sting": return (T)"Arne"; case "Long": return (T) (Long) 2L; } return null; } }; assertTrue(e.invoke(1, classMapper)); }