MailRepositoryPath implements Comparable<MailRepositoryPath> { public static MailRepositoryPath fromEncoded(String encodedPath) throws UnsupportedEncodingException { Preconditions.checkNotNull(encodedPath, "Supplied MailRepositoryPath value is null"); return from(URLDecoder.decode(encodedPath, StandardCharsets.UTF_8.displayName())); } 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 fromEncodedShouldRejectNull() { assertThatThrownBy(() -> MailRepositoryPath.fromEncoded(null)) .isInstanceOf(NullPointerException.class); }