private static final KeyValue<TestInputUser, TestInputWord>[] INPUT_MESSAGES = new KeyValue[]
{
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(PETER),
TestInputWord.of(PETER, WORD_HALLO)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(KLAUS),
TestInputWord.of(KLAUS, WORD_MÜSCH)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(PETER),
TestInputWord.of(PETER, WORD_WELT)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(KLAUS),
TestInputWord.of(KLAUS, WORD_MÜSCH)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(KLAUS),
TestInputWord.of(KLAUS, WORD_S)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(PETER),
TestInputWord.of(PETER, WORD_BOÄH)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(PETER),
TestInputWord.of(PETER, WORD_WELT)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(PETER),
TestInputWord.of(PETER, WORD_BOÄH)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(KLAUS),
TestInputWord.of(KLAUS, WORD_S)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(PETER),
TestInputWord.of(PETER, WORD_BOÄH)),
- new KeyValue<>(
+ KeyValue.pair(
TestInputUser.of(KLAUS),
TestInputWord.of(KLAUS, WORD_S)),
};
private static int countMessagesForWord(TestOutputWord word, MultiValueMap<TestOutputWord, TestOutputWordCounter> messagesForUsers)
{
- return messagesForUsers.get(word).size();
+ return messagesForUsers.get(word) == null
+ ? 0
+ : messagesForUsers.get(word).size();
}
static void assertExpectedState(ReadOnlyKeyValueStore<Word, Long> store)