### Question:
Util { public static Throwable unwindException(Throwable th) { if (th instanceof SAXException) { SAXException sax = (SAXException) th; if (sax.getException() != null) { return unwindException(sax.getException()); } } else if (th instanceof SQLException) { SQLException sql = (SQLException) th; if (sql.getNextException() != null) { return unwindException(sql.getNextException()); } } else if (th.getCause() != null) { return unwindException(th.getCause()); } return th; }  static File toFile(URL url); static String stringFromFile(File file); static String stringFromFile(File file, String joinWith); static String join(Iterable<?> objects, String separator); static String substBackslashes(String string); static Throwable unwindException(Throwable th); static boolean nullSafeEquals(Object o1, Object o2); static int nullSafeCompare(boolean nullsFirst, Comparable<T> o1, T o2); static boolean isEmptyString(CharSequence string); static boolean isBlank(CharSequence cs); static boolean isNumeric(CharSequence cs); static int countMatches(final String str, final String sub); static String capitalized(String name); static String uncapitalized(String aString); @SuppressWarnings("unchecked") static T cloneViaSerialization(T object); static XMLReader createXmlReader(); static Document readDocument(URL url); static String getPackagePath(String className); static String stripPackageName(String className); static Map<K, V> toMap(K[] keys, V[] values); static String extractFileExtension(String fileName); static String stripFileExtension(String fileName); static String stripLineBreaks(String string, char replaceWith); static String encodeXmlAttribute(String string); static String prettyTrim(String str, int maxLength); static Iterator<T> sortedIterator(Iterator<T> it, Comparator<T> comparator); static int hashCode(Collection<?> c); static Pattern sqlPatternToPattern(String pattern, boolean ignoreCase); static boolean isAccessible(Member member); @Deprecated static Class<?> getJavaClass(String className); static String underscoredToJava(String name, boolean capitalize); static String specialCharsToJava(String string);  }### Answer:
@Test public void testUnwindException1() throws Exception { Throwable e = new Throwable(); assertSame(e, Util.unwindException(e)); }
@Test public void testUnwindException2() throws Exception { CayenneRuntimeException e = new CayenneRuntimeException(); assertSame(e, Util.unwindException(e)); }
@Test public void testUnwindException3() throws Exception { Throwable root = new Throwable(); CayenneRuntimeException e = new CayenneRuntimeException(root); assertSame(root, Util.unwindException(e)); }