### Question:
TracerouteWindow extends Window { protected URL buildURL() { boolean validInput = false; try { validInput = validateInput(); } catch (Exception e) { getApplication().getMainWindow().showNotification(e.getMessage(), Notification.TYPE_WARNING_MESSAGE); return null; } if (validInput) { final URL baseUrl = getApplication().getURL(); final StringBuilder options = new StringBuilder(tracerouteUrl); options.append("&address=").append(ipDropdown.getValue()); if (!("".equals(forcedHopField.getValue().toString()))) { options.append("&hopAddress=").append(forcedHopField.getValue()); } if (numericalDataCheckBox.getValue().equals(true)) { options.append("&numericOutput=true"); } try { return new URL(baseUrl, options.toString()); } catch (final MalformedURLException e) { getApplication().getMainWindow().showNotification("Could not build URL: " + options.toString(), Notification.TYPE_WARNING_MESSAGE); return null; } } else { getApplication().getMainWindow().showNotification("Invalid IP addresss", Notification.TYPE_WARNING_MESSAGE); return null; } } TracerouteWindow(final Node node, final String url); @Override void attach();  }### Answer:
@Test public void testBuildURL_correctInput() { traceWindow.numericalDataCheckBox.setValue(true); traceWindow.forcedHopField.setValue("127.0.0.1"); assertNotNull(traceWindow.buildURL()); }
@Test public void testBuildURL_malformedURL() { traceWindow3.numericalDataCheckBox.setValue(true); traceWindow3.forcedHopField.setValue("127.0.0.1"); assertNull(traceWindow3.buildURL()); }
@Test public void testBuildURL_upperBounds() { traceWindow.numericalDataCheckBox.setValue(true); traceWindow.forcedHopField.setValue("256.256.256.256"); assertNull(traceWindow.buildURL()); }
@Test public void testBuildURL_lowerBounds() { traceWindow.forcedHopField.setValue("-1.-1.-1.-1"); assertNull(traceWindow.buildURL()); }
@Test public void testBuildURL_nonIntegerInput() { traceWindow.forcedHopField.setValue("abc.def.ghi.jkl"); assertNull(traceWindow.buildURL()); }
@Test public void testBuildURL_notIPAddress() { traceWindow.forcedHopField.setValue("not an IP"); assertNull(traceWindow.buildURL()); }
@Test public void testBuildURL_negativeIntegers() { traceWindow.forcedHopField.setValue("-255.-255.-255.-255"); assertNull(traceWindow.buildURL()); }