Path { @Override public String toString() { return rawPath == null ? "" : rawPath; } Path(String rawPath, PathParam ... params); String valueFor(String key); String valueFor(String key, String defaultValue); int size(); @Override String toString(); Optional<String> get(String key); String show(); boolean eq(Path that);  }
@Test public void toStringDoesWhatYouWouldExpect(){ Path testSubject = new Path("/foo/bar"); String result = testSubject.toString(); assertEquals("/foo/bar", result); }
@Test public void toStringIsNullSafe(){ Path testSubject = new Path(null); String result = testSubject.toString(); assertEquals("", result); }