### Question:
MessageDispatcher { public MessagePromise expect(String messageId, Set<Predicate> predicates) { Reject.ifTrue(StringUtils.isBlank(messageId)); Reject.ifNull(predicates); MessagePromise mp = new MessagePromise(PromiseImpl.<JsonValue, Exception>create(), predicates); cache.put(messageId, mp); return mp; } @Inject  MessageDispatcher(Cache<String, MessagePromise> dispatch, @Named("frPush") Debug debug); void handle(String messageId, JsonValue content); MessagePromise expect(String messageId, Set<Predicate> predicates); boolean forget(String messageId);  }### Answer:
@Test public void shouldReturnEmptyPromiseForexpectdMessageId() { MessagePromise result = messageDispatcher.expect("expectMessage", new HashSet<Predicate>()); assertThat(result.getPromise().isDone()).isFalse(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void shouldErrorWhenPrimpedForNullMessageId() { messageDispatcher.expect(null, null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void shouldErrorWhenPrimpedForEmptyMessageId() { messageDispatcher.expect("", new HashSet<Predicate>()); }