### Question:
RestRouteSource implements PrefixedRouteSource { @Override public void validate() { if (pathPrefix == null || !pathPrefix.matches("\\w+")) { throw new IllegalArgumentException("Path is incorrect"); } } RestRouteSource(String pathPrefix); @Override String getRoutePrefix(); @Override String toString(); @Override void validate();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void shouldValidatePath() { new RestRouteSource(null).validate(); }
@Test(expected = IllegalArgumentException.class) public void shouldValidateWithWhiteCharacters() { new RestRouteSource("12312 234").validate(); }
@Test(expected = IllegalArgumentException.class) public void shouldValidateStartingSlash() { new RestRouteSource("/test").validate(); }
@Test public void shouldPassOnCorrectPath() { new RestRouteSource("correctPath").validate(); }