ConvertInterceptorChainPiece implements ConvertSourceTarget { @Override public <T> T convert(Object source, T target, boolean isTargetTo, String... tags) { return interceptor.convert(source, target, isTargetTo, next, tags); } ConvertInterceptorChainPiece(ConvertInterceptor interceptor, ConvertSourceTarget next); @Override T convert(Object source, T target, boolean isTargetTo, String... tags);  }
@Test public void testChain() throws Exception { ConvertInterceptor interceptor = mock(ConvertInterceptor.class); ConvertSourceTarget next = mock(ConvertSourceTarget.class); ConvertInterceptorChainPiece chainPiece = new ConvertInterceptorChainPiece(interceptor, next); Object source = mock(Object.class); Object target = mock(Object.class); String[] tags = new String[] { "bla" }; chainPiece.convert(source, target, true, tags); verify(interceptor).convert(source, target, true, next, tags); }