public void testChainInpstectingDelegation() {
DelegatingExceptionHandler delegatingExceptionHandler = new DelegatingExceptionHandler();
List<ExceptionHandlerDelegate> delegateList = new LinkedList<ExceptionHandlerDelegate>();
List<ChainPart> chainPartList = new ArrayList<ChainPart>();
chainPartList.add(new ChainPart(IllegalArgumentException.class, 0, 2));
chainPartList.add(new ChainPart(IllegalStateException.class, 1));
ExceptionHandlerCounter chainCounter = new ExceptionHandlerCounter();
delegateList.add(new ChainInspectingExceptionHandlerDelegate(chainPartList, chainCounter));
List<ChainPart> cornerChainPartList = new ArrayList<ChainPart>();
cornerChainPartList.add(new ChainPart(NumberFormatException.class));
ExceptionHandlerCounter cornerCounter = new ExceptionHandlerCounter();
delegateList.add(new ChainInspectingExceptionHandlerDelegate(cornerChainPartList, cornerCounter));
ExceptionHandlerCounter runtimeCounter = new ExceptionHandlerCounter();
delegateList.add(new SimpleExceptionHandlerDelegate(RuntimeException.class, runtimeCounter));
delegatingExceptionHandler.setDelegateList(delegateList);