### Question:
IpHelper { public static boolean isNetworkConnectionException(Exception ex) { return Debug.isThrowableCausedByOrAssignableFrom(ex, SocketException.class, SocketTimeoutException.class); }  static String createZeusIpString(String ipAddress, Integer port); static boolean isNetworkConnectionException(Exception ex);  }### Answer:
@Test public void testIsConnectionException() { List<Exception> exceptionsThatShouldMarkEndpointAsBad = new ArrayList<Exception>(); exceptionsThatShouldMarkEndpointAsBad.add(new NoRouteToHostException()); exceptionsThatShouldMarkEndpointAsBad.add(new PortUnreachableException()); exceptionsThatShouldMarkEndpointAsBad.add(new BindException()); exceptionsThatShouldMarkEndpointAsBad.add(new ConnectException()); exceptionsThatShouldMarkEndpointAsBad.add(new SocketTimeoutException()); for (Exception ex : exceptionsThatShouldMarkEndpointAsBad) { Exception axisFault = AxisFault.makeFault(ex); Exception zxtmException = new ZxtmRollBackException(ex); String excClassName = ex.getClass().getSimpleName(); String expected = "Excpected isNetworkConnectionException(" + excClassName + ") == True but was False"; assertTrue(expected, IpHelper.isNetworkConnectionException(ex)); assertTrue(expected, IpHelper.isNetworkConnectionException(axisFault)); assertTrue(expected, IpHelper.isNetworkConnectionException(zxtmException)); } List<Exception> exceptionsThatShouldBeIgnored = new ArrayList<Exception>(); exceptionsThatShouldBeIgnored.add(new IOException()); exceptionsThatShouldBeIgnored.add(new ArithmeticException()); exceptionsThatShouldBeIgnored.add(new ArrayIndexOutOfBoundsException()); exceptionsThatShouldBeIgnored.add(new IllegalArgumentException()); exceptionsThatShouldBeIgnored.add(new RuntimeException()); exceptionsThatShouldBeIgnored.add(AxisFault.makeFault(new Exception())); exceptionsThatShouldBeIgnored.add(new ZxtmRollBackException(new Exception())); for (Exception ex : exceptionsThatShouldBeIgnored) { Exception axisFault = AxisFault.makeFault(ex); Exception zxtmException = new ZxtmRollBackException(ex); String excClassName = ex.getClass().getSimpleName(); String expected = "Excpected isNetworkConnectionException(" + excClassName + ") == False but was True"; assertFalse(IpHelper.isNetworkConnectionException(ex)); assertFalse(IpHelper.isNetworkConnectionException(axisFault)); assertFalse(IpHelper.isNetworkConnectionException(zxtmException)); } }