diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/ClientSafeException.java b/common/source/java/ch/systemsx/cisd/common/utilities/ClientSafeException.java
index 72464dbba75877f48835ca7e7b45e8961f4c6c2c..2900bd0eec4a0b8c5e72ffbe4f8d96bc2923496f 100644
--- a/common/source/java/ch/systemsx/cisd/common/utilities/ClientSafeException.java
+++ b/common/source/java/ch/systemsx/cisd/common/utilities/ClientSafeException.java
@@ -68,7 +68,7 @@ public final class ClientSafeException extends RuntimeException
     /**
      * Whether given <var>exception</var> is client-safe or not.
      */
-    private final static boolean isClientSafe(final Exception exception)
+    final static boolean isClientSafe(final Exception exception)
     {
         assert exception != null : "Unspecified exception.";
         final String className = exception.getClass().getName();
diff --git a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/ClientSafeExceptionTest.java b/common/sourceTest/java/ch/systemsx/cisd/common/utilities/ClientSafeExceptionTest.java
index f5e5943d86aa03fdf050ea5adb7942df1e073d4c..8a5dde3e429026f506aea15223f2b262748417a0 100644
--- a/common/sourceTest/java/ch/systemsx/cisd/common/utilities/ClientSafeExceptionTest.java
+++ b/common/sourceTest/java/ch/systemsx/cisd/common/utilities/ClientSafeExceptionTest.java
@@ -16,7 +16,18 @@
 
 package ch.systemsx.cisd.common.utilities;
 
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotSame;
+import static org.testng.AssertJUnit.assertSame;
+import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
+
+import java.util.Arrays;
+
 import org.testng.annotations.Test;
+import org.xml.sax.SAXException;
+
+import ch.systemsx.cisd.common.exceptions.UserFailureException;
 
 /**
  * Test cases for the {@link ClientSafeExceptionTest}.
@@ -26,9 +37,87 @@ import org.testng.annotations.Test;
 public final class ClientSafeExceptionTest
 {
 
+    private void checkReturnedClientSafeException(final String message, final Exception rootException,
+            final Exception clientSafeException)
+    {
+        if (ClientSafeException.isClientSafe(rootException))
+        {
+            assertSame(clientSafeException, rootException);
+        } else
+        {
+            assertNotSame(clientSafeException, rootException);
+            assertTrue(clientSafeException instanceof ClientSafeException);
+        }
+        assertEquals(message, clientSafeException.getMessage());
+        assertTrue(Arrays.equals(rootException.getStackTrace(), clientSafeException.getStackTrace()));
+        if (rootException.getCause() != null)
+        {
+            assertTrue(clientSafeException.getCause() != null);
+        }
+    }
+
+    @Test
+    public final void testWithNullException()
+    {
+        try
+        {
+            ClientSafeException.createClientSafeExceptionIfNeeded(null);
+            fail("Null exception not allowed.");
+        } catch (final AssertionError ex)
+        {
+            // Nothing to do here.
+        }
+    }
+
+    @Test
+    public final void testWithClientSafeExceptionOneLevel()
+    {
+        final String message = "Oooops!";
+        final UserFailureException exception = new UserFailureException(message);
+        final Exception clientSafeException = ClientSafeException.createClientSafeExceptionIfNeeded(exception);
+        assertSame(clientSafeException, exception);
+    }
+
     @Test
-    public final void test()
+    public final void testWithNonClientSafeExceptionOneLevel()
     {
-        System.out.println(null instanceof String);
+        final String message = "Oooops!";
+        final Exception exception = new SAXException(message);
+        final Exception clientSafeException = ClientSafeException.createClientSafeExceptionIfNeeded(exception);
+        checkReturnedClientSafeException(message, exception, clientSafeException);
     }
+
+    @Test
+    public final void testWithClientSafeExceptionMultipleLevel()
+    {
+        final String userFailureText = "Oooops!";
+        final UserFailureException userFailureException = new UserFailureException(userFailureText);
+        final String runtimeText = "Oooops! I did it again...";
+        final RuntimeException runtimeException = new RuntimeException(runtimeText, userFailureException);
+        final String unsupportedOperationText = "Wishiiiii!";
+        final UnsupportedOperationException unsupportedOperationException =
+                new UnsupportedOperationException(unsupportedOperationText, runtimeException);
+        final Exception clientSafeException =
+                ClientSafeException.createClientSafeExceptionIfNeeded(unsupportedOperationException);
+        checkReturnedClientSafeException(unsupportedOperationText, unsupportedOperationException, clientSafeException);
+        checkReturnedClientSafeException(runtimeText, runtimeException, (Exception) clientSafeException.getCause());
+        checkReturnedClientSafeException(userFailureText, userFailureException, (Exception) clientSafeException
+                .getCause().getCause());
+    }
+
+    @Test
+    public final void testWithNonClientSafeExceptionMultipleLevel()
+    {
+    }
+
+    @Test
+    public final void testWithCheckedExceptionTunnel()
+    {
+    }
+
+    @Test
+    public final void testWithGetCauseReturningItSelf()
+    {
+    }
+
 }