MailboxAnnotationKey { public int countComponents() { return StringUtils.countMatches(key, SLASH_CHARACTER); } MailboxAnnotationKey(String key); int countComponents(); String asString(); boolean isParentOrIsEqual(MailboxAnnotationKey key); boolean isAncestorOrIsEqual(MailboxAnnotationKey key); @Override boolean equals(Object obj); @Override int hashCode(); static final String SLASH_CHARACTER; static final String TWO_SLASH_CHARACTER; static final int MINIMUM_COMPONENTS; static final int MINIMUM_COMPONENTS_OF_VENDOR; static final int SECOND_COMPONENT_INDEX; static final String VENDOR_COMPONENT; }
@Test void countSlashShouldReturnRightNumberOfSlash() { MailboxAnnotationKey annotationKey = new MailboxAnnotationKey("/private/comment/user/name"); assertThat(annotationKey.countComponents()).isEqualTo(4); }