### Question:
GeocoderServer { @GET @Produces({MediaType.APPLICATION_XML + "; charset=UTF-8", MediaType.APPLICATION_JSON + "; charset=UTF-8"}) public GeocoderResults geocode( @QueryParam("address") String address, @QueryParam("bbox") String bbox) { if (address == null) { error("no address"); } if (bbox != null) { String[] elem = bbox.split(","); if (elem.length == 4) { try { double x1 = Double.parseDouble(elem[0]); double y1 = Double.parseDouble(elem[1]); double x2 = Double.parseDouble(elem[2]); double y2 = Double.parseDouble(elem[3]); Envelope envelope = new Envelope(new Coordinate(x1, y1), new Coordinate(x2, y2)); return geocoder.geocode(address, envelope); } catch (NumberFormatException e) { error("bad bounding box: use left,top,right,bottom"); } } else { error("bad bounding box: use left,top,right,bottom"); } } return geocoder.geocode(address, null); }  void setGeocoder(Geocoder geocoder); @GET @Produces({MediaType.APPLICATION_XML + "; charset=UTF-8", MediaType.APPLICATION_JSON + "; charset=UTF-8"}) GeocoderResults geocode(
            @QueryParam("address") String address,
            @QueryParam("bbox") String bbox);  }### Answer:
@Test(expected = WebApplicationException.class) public void testGeocodeNoAddress() { geocoderServer.geocode(null, null); fail("Should have thrown an error"); }