@Override public <I> I registerCommandGateway(Class<I> gatewayInterface, final I stubImplementation) { CommandGatewayFactory factory = StubAwareCommandGatewayFactory.builder() .commandBus(SagaTestFixture.this.commandBus) .stubImplementation(stubImplementation) .build(); final I gateway = factory.createGateway(gatewayInterface); registerResource(gateway); return gateway; }