PlaceRequest { public static Builder of(String nameToken) { return new Builder().nameToken(nameToken); } private  PlaceRequest(String nameToken, Map<String, String> params); String getNameToken(); String getParameter(String key, String defaultValue); Set<String> getParameterNames(); boolean matchesNameToken(PlaceRequest other); boolean matchesNameToken(String nameToken); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); static Builder of(String nameToken);  }
@Test public void shouldBuildRequestFromExistingRequest() { PlaceRequest request = PlaceRequest.of("nameToken").build(); PlaceRequest copyOfRequest = new PlaceRequest.Builder(request).build(); assertEquals(request, copyOfRequest); }