static public <EX extends Throwable> EX throwDeepCauseChecked(Throwable t, Class<? extends EX> clazz) throws EX {
		if (t == null ) {
		   throw new NullPointerException();
	    }
	    Error firstError=null;
	    EX firstEX=null;
	    RuntimeException firstRTE=null;
	    // Walk chain finding first item of each interesting class.
	    for (Throwable tt=t;tt!=null;tt=tt.getCause()) {
	    	firstError = ExceptionUtil.chooseNonNullCorrectClass(Error.class,firstError,tt);
	    	firstEX = ExceptionUtil.chooseNonNullCorrectClass(clazz,firstEX,tt);
	    	firstRTE = ExceptionUtil.chooseNonNullCorrectClass(RuntimeException.class,firstRTE,tt);
	    }
	    if (firstError!=null) { throw firstError; }
	    if (firstEX!=null) { throw firstEX; }
	    if (firstRTE!=null) { throw firstRTE; }
	    
	    // Wrap original problem in clazz.
	    EX rslt = null;
	    try {
	    	rslt = (EX)clazz.getConstructor(Throwable.class).newInstance(t);
		}
		catch (Exception e) {
			try {
				rslt = (EX)clazz.newInstance();
				rslt.initCause(t);
			}
			catch (Exception e1) {
				if (e1.getCause()==null) {
					e1.initCause(t);
				}
				throw new IllegalArgumentException(
						clazz.getName()+" does not have a functioning constructor, with either no arguments or a Throwable argument.",
						e1);
			}
		}
		throw rslt;
		// NOT REACHED.
	}