ExactName implements MailboxNameExpression { @Override public boolean isExpressionMatch(String mailboxName) { Preconditions.checkNotNull(mailboxName); return name.equals(mailboxName); } ExactName(String name); @Override boolean isExpressionMatch(String mailboxName); @Override String getCombinedName(); @Override boolean isWild(); @Override MailboxNameExpression includeChildren(); @Override final boolean equals(Object o); @Override final int hashCode();  }
@Test void isExpressionMatchShouldReturnTrueWhenName() { assertThat(new ExactName(NAME).isExpressionMatch(NAME)) .isTrue(); }
@Test void isExpressionMatchShouldReturnFalseWhenOtherValue() { assertThat(new ExactName(NAME).isExpressionMatch("other")) .isFalse(); }
@Test void isExpressionMatchShouldThrowOnNullValue() { assertThatThrownBy(() -> new ExactName(NAME).isExpressionMatch(null)) .isInstanceOf(NullPointerException.class); }