@VisibleForTesting
    Optional<EventProcessorStateDto> findByEventDefinitionId(String eventDefinitionId) {
        checkArgument(!isNullOrEmpty(eventDefinitionId), "eventDefinitionId cannot be null or empty");

        return Optional.ofNullable(db.findOne(DBQuery.is(FIELD_EVENT_DEFINITION_ID, eventDefinitionId)));
    }
@Test
    @MongoDBFixtures("event-processor-state.json")
    public void findByEventProcessorId() {
        assertThat(stateService.findByEventDefinitionId("54e3deadbeefdeadbeefaff3")).isPresent();

        assertThat(stateService.findByEventDefinitionId("nope")).isNotPresent();

        assertThatThrownBy(() -> stateService.findByEventDefinitionId(null))
                .hasMessageContaining("eventDefinitionId")
                .isInstanceOf(IllegalArgumentException.class);

        assertThatThrownBy(() -> stateService.findByEventDefinitionId(""))
                .hasMessageContaining("eventDefinitionId")
                .isInstanceOf(IllegalArgumentException.class);
    }