MailRepositoryPath implements Comparable<MailRepositoryPath> { public static MailRepositoryPath from(String path) { Preconditions.checkNotNull(path, "Supplied MailRepositoryPath value is null"); return new MailRepositoryPath(sanitizePath(path)); } private  MailRepositoryPath(String value); static MailRepositoryPath fromEncoded(String encodedPath); static MailRepositoryPath from(String path); MailRepositoryPath subPath(String suffix); boolean hasPrefix(MailRepositoryPath other); List<String> parts(); String asString(); String urlEncoded(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); @Override int compareTo(MailRepositoryPath that);  }
@Test void fromShouldRemoveTrailingSlash() { assertThat(MailRepositoryPath.from("abc/def/")) .isEqualTo(MailRepositoryPath.from("abc/def")); }
@Test void fromShouldRemoveTrailingSlashes() { assertThat(MailRepositoryPath.from("abc/def .isEqualTo(MailRepositoryPath.from("abc/def")); }
@Test void fromShouldAcceptRemoveTrailingSlashesWhenOnlySlashes() { assertThat(MailRepositoryPath.from(" .isEqualTo(MailRepositoryPath.from("")); }
@Test void fromShouldRejectNull() { assertThatThrownBy(() -> MailRepositoryPath.from(null)) .isInstanceOf(NullPointerException.class); }