### Question:
JSExceptionWrapperMapper implements ExceptionMapper<JSExceptionWrapper> { private Exception getRootException(JSExceptionWrapper exceptionWrapper) { Exception originalException = exceptionWrapper.getOriginalException(); if (originalException == null) return exceptionWrapper; if (originalException instanceof JSExceptionWrapper) { return getRootException((JSExceptionWrapper) originalException); } if (originalException instanceof CacheDatasetException) { return (Exception) ExceptionUtils.getRootCause(originalException); } return originalException; }  @Override Response toResponse(JSExceptionWrapper exception);  }### Answer:
@Test public void getRootException(){ JSExceptionWrapperMapper jsExceptionWrapperMapper = new JSExceptionWrapperMapper(); IllegalParameterValueException illegalParameterValueException = new IllegalParameterValueException("dataSource"); Exception result = null; try { Method method = JSExceptionWrapperMapper.class.getDeclaredMethod("getRootException", JSExceptionWrapper.class); method.setAccessible(true); result = (Exception) method.invoke(jsExceptionWrapperMapper, new JSExceptionWrapper( illegalParameterValueException)); } catch (Exception ex) { } assertNotNull(result); assertSame(result, illegalParameterValueException); }