MailboxNamespace { public static MailboxNamespace delegated(Username owner) { Preconditions.checkArgument(owner != null); return new MailboxNamespace(Type.Delegated, Optional.of(owner)); } private  MailboxNamespace(Type type, Optional<Username> owner); static MailboxNamespace delegated(Username owner); static MailboxNamespace personal(); Type getType(); @JsonInclude(JsonInclude.Include.NON_EMPTY) Optional<Username> getOwner(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString();  }
@Test public void delegatedShouldThrowWhenNullOwner() throws Exception { assertThatThrownBy(() -> MailboxNamespace.delegated(null)) .isInstanceOf(IllegalArgumentException.class); }
@Test public void delegatedShouldThrowWhenEmptyOwner() throws Exception { assertThatThrownBy(() -> MailboxNamespace.delegated(Username.of(""))) .isInstanceOf(IllegalArgumentException.class); }
@Test public void delegatedShouldThrowWhenBlankOwner() throws Exception { assertThatThrownBy(() -> MailboxNamespace.delegated(Username.of(" "))) .isInstanceOf(IllegalArgumentException.class); }