@Test
public void findSagaInstanceKey_searchAlreadyDoneForOtherType_returnsDefinedKey() {

    // given
    final String keyValue = "theKeyValue";
    KeyReader intReader = FunctionKeyReader.create(Integer.class, new KeyReadFunction<Integer>() {
        @Override
        public String key(final Integer intValue) {
            return "42";
        }
    });
    KeyReader reader = FunctionKeyReader.create(String.class, new KeyReadFunction<String>() {
        @Override
        public String key(final String s) {
            return keyValue;
        }
    });
    when(testSaga.keyReaders()).thenReturn(Lists.newArrayList(reader, intReader));
    sut.findSagaInstanceKey(Saga.class, SagaLookupContext.forMessage(new Integer(5)));
    // when
    Object foundKey = sut.findSagaInstanceKey(Saga.class, SagaLookupContext.forMessage("my input event message"));
    // then
    assertThat("Expected returned key to match key value provided reader.", foundKey, equalTo((Object) keyValue));
}