### Question:
ResourcePaths { public static ResourcePath path(String path) { if (path == null) { throw new IllegalArgumentException("Method argument path must not be null"); } if (PLACEHOLDER.matcher(path).find()) { return new PathWithPlaceholders(path); } return new PathWithoutPlaceholders(path); }  static ResourcePath path(String path);  }### Answer:
@Test public void testDetectionOfVariables() { assertThat(path("").hasPlaceholders()).isFalse(); assertThat(path("${variable}").hasPlaceholders()).isTrue(); }
@Test public void testPathRepresentationOfUnresolvedPathWithPlaceholders() { assertThat(path("/some/${placeholders}/in/${path}").getPath()) .isEqualTo("/some/${placeholders}/in/${path}"); }
@Test public void testToStringOfPlaceWithoutPlaceholders() { assertThat(path("/path/without/placeholders")) .hasToString("/path/without/placeholders"); }
@Test public void testToStringOfPlaceWithPlaceholders() { assertThat(path("/path/${with}/placeholders")) .hasToString("/path/${with}/placeholders"); }