@Subscribe
    public void inputCreated(InputCreated inputCreatedEvent) {
        final String inputId = inputCreatedEvent.id();
        LOG.debug("Input created: {}", inputId);
        final Input input;
        try {
            input = inputService.find(inputId);
        } catch (NotFoundException e) {
            LOG.warn("Received InputCreated event but could not find input {}", inputId, e);
            return;
        }

        final IOState<MessageInput> inputState = inputRegistry.getInputState(inputId);
        if (inputState != null) {
            inputRegistry.remove(inputState);
        }

        if (input.isGlobal() || this.nodeId.getNodeId().equals(input.getNodeId())) {
            startInput(input);
        }
    }
@Test
    @SuppressWarnings("unchecked")
    public void inputCreatedDoesNotStopInputIfItIsNotRunning() throws Exception {
        final String inputId = "input-id";
        final Input input = mock(Input.class);
        when(inputService.find(inputId)).thenReturn(input);
        when(inputRegistry.getInputState(inputId)).thenReturn(null);

        listener.inputCreated(InputCreated.create(inputId));

        verify(inputRegistry, never()).remove(any(IOState.class));
    }