### Question:
IOExceptionSupport { public static IOException create(Throwable cause) { if (cause instanceof IOException) { return (IOException) cause; } String message = cause.getMessage(); if (message == null || message.length() == 0) { message = cause.toString(); } return new IOException(message, cause); }  static IOException create(Throwable cause);  }### Answer:
@Test public void testPassthrough() { IOException cause = new IOException(); assertSame(cause, IOExceptionSupport.create(cause)); }
@Test public void testCreateWithMessage() { IOException ex = IOExceptionSupport.create(new RuntimeException("error")); assertEquals("error", ex.getMessage()); }
@Test public void testCreateWithoutMessage() { IOException ex = IOExceptionSupport.create(new RuntimeException()); assertNotNull(ex.getMessage()); }
@Test public void testCreateWithEmptyMessage() { IOException ex = IOExceptionSupport.create(new RuntimeException("")); assertNotNull(ex.getMessage()); }