}
@Test
public void testPrecedence() throws Exception
{
InterceptorRegistry registry = new InterceptorRegistry(Object.class, ResteasyProviderFactory.getInstance());
registry.appendPrecedence("A");
registry.appendPrecedence("B");
registry.appendPrecedence("C");
registry.appendPrecedence("D");
registry.insertPrecedenceAfter("C", "AfterC");
registry.insertPrecedenceBefore("B", "BeforeB");
registry.insertPrecedenceBefore("A", "BeforeA");
registry.insertPrecedenceAfter("D", "AfterD");
registry.register(PrecedenceTest.class);
registry.register(B.class);
registry.register(DClass.class);
registry.register(C.class);
registry.register(A.class);
registry.register(AfterD.class);
registry.register(BeforeA.class);
registry.register(BeforeB.class);
registry.register(AfterC.class);
Object[] array = registry.bind(null, null);
for (Object obj : array) System.out.println(obj.getClass().getName());
Assert.assertEquals(array[0].getClass(), BeforeA.class);
Assert.assertEquals(array[1].getClass(), A.class);