MailboxAnnotation { public static MailboxAnnotation newInstance(MailboxAnnotationKey key, String value) { return new MailboxAnnotation(key, Optional.of(value)); } private  MailboxAnnotation(MailboxAnnotationKey key, Optional<String> value); static MailboxAnnotation nil(MailboxAnnotationKey key); static MailboxAnnotation newInstance(MailboxAnnotationKey key, String value); MailboxAnnotationKey getKey(); Optional<String> getValue(); int size(); @Override int hashCode(); boolean isNil(); @Override boolean equals(Object obj); @Override String toString();  }
@Test void newInstanceShouldThrowsExceptionWithNullKey() { assertThatThrownBy(() -> MailboxAnnotation.newInstance(null, null)) .isInstanceOf(NullPointerException.class); }
@Test void newInstanceShouldThrowsExceptionWithNullValue() { assertThatThrownBy(() -> MailboxAnnotation.newInstance(ANNOTATION_KEY, null)) .isInstanceOf(NullPointerException.class); }