### Question:
ColocUtil { public static InterceptorChain getInInterceptorChain(Exchange ex, SortedSet<Phase> phases) { Bus bus = ex.getBus(); PhaseInterceptorChain chain = new PhaseInterceptorChain(phases); Endpoint ep = ex.getEndpoint(); List<Interceptor<? extends Message>> il = ep.getInInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by endpoint: " + il); } chain.add(il); il = ep.getService().getInInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by service: " + il); } chain.add(il); il = bus.getInInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by bus: " + il); } chain.add(il); if (ep.getService().getDataBinding() instanceof InterceptorProvider) { il = ((InterceptorProvider)ep.getService().getDataBinding()).getInInterceptors(); if (LOG.isLoggable(Level.FINE)) { LOG.fine("Interceptors contributed by databinding: " + il); } chain.add(il); } chain.setFaultObserver(new ColocOutFaultObserver(bus)); modifyChain(chain, ex, true); return chain; } private  ColocUtil(); static void setPhases(SortedSet<Phase> list, String start, String end); static InterceptorChain getOutInterceptorChain(Exchange ex, SortedSet<Phase> phases); static InterceptorChain getInInterceptorChain(Exchange ex, SortedSet<Phase> phases); static boolean isSameOperationInfo(OperationInfo oi1, OperationInfo oi2); static boolean isCompatibleOperationInfo(OperationInfo oi1, OperationInfo oi2); static boolean isAssignableOperationInfo(OperationInfo oi, Class<?> cls); static boolean isSameMessageInfo(MessageInfo mi1, MessageInfo mi2); static boolean isSameFaultInfo(Collection<FaultInfo> fil1,
                                          Collection<FaultInfo> fil2); static void convertSourceToObject(Message message); static void convertObjectToSource(Message message);  }### Answer:
@Test public void testGetInInterceptorChain() throws Exception { PhaseManagerImpl phaseMgr = new PhaseManagerImpl(); SortedSet<Phase> list = phaseMgr.getInPhases(); ColocUtil.setPhases(list, Phase.SETUP, Phase.POST_LOGICAL); Endpoint ep = control.createMock(Endpoint.class); Service srv = control.createMock(Service.class); Exchange ex = new ExchangeImpl(); ex.put(Bus.class, bus); ex.put(Endpoint.class, ep); ex.put(Service.class, srv); EasyMock.expect(bus.getExtension(PhaseManager.class)).andReturn(phaseMgr); EasyMock.expect(ep.getInInterceptors()) .andReturn(new ArrayList<Interceptor<? extends Message>>()).atLeastOnce(); EasyMock.expect(ep.getService()).andReturn(srv).atLeastOnce(); EasyMock.expect(srv.getInInterceptors()) .andReturn(new ArrayList<Interceptor<? extends Message>>()).atLeastOnce(); EasyMock.expect(bus.getInInterceptors()) .andReturn(new ArrayList<Interceptor<? extends Message>>()).atLeastOnce(); control.replay(); InterceptorChain chain = ColocUtil.getInInterceptorChain(ex, list); control.verify(); assertNotNull("Should have chain instance", chain); Iterator<Interceptor<? extends Message>> iter = chain.iterator(); assertFalse("Should not have interceptors in chain", iter.hasNext()); assertNotNull("OutFaultObserver should be set", chain.getFaultObserver()); }