### Question:
ColocUtil { public static boolean isSameMessageInfo(MessageInfo mi1, MessageInfo mi2) { if ((mi1 == null && mi2 != null) || (mi1 != null && mi2 == null)) { return false; } if (mi1 != null && mi2 != null) { List<MessagePartInfo> mpil1 = mi1.getMessageParts(); List<MessagePartInfo> mpil2 = mi2.getMessageParts(); if (mpil1.size() != mpil2.size()) { return false; } int idx = 0; for (MessagePartInfo mpi1 : mpil1) { MessagePartInfo mpi2 = mpil2.get(idx); if (!mpi1.getTypeClass().equals(mpi2.getTypeClass())) { return false; } ++idx; } } return true; } 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 testIsSameMessageInfo() { OperationInfo oi = control.createMock(OperationInfo.class); boolean match = ColocUtil.isSameMessageInfo(null, null); assertTrue("Should return true", match); QName mn1 = new QName("A", "B"); QName mn2 = new QName("C", "D"); MessageInfo mi1 = new MessageInfo(oi, MessageInfo.Type.INPUT, mn1); MessageInfo mi2 = new MessageInfo(oi, MessageInfo.Type.INPUT, mn2); match = ColocUtil.isSameMessageInfo(mi1, null); assertFalse("Should not find a match", match); match = ColocUtil.isSameMessageInfo(null, mi2); assertFalse("Should not find a match", match); MessagePartInfo mpi = new MessagePartInfo(new QName("", "B"), null); mpi.setTypeClass(InHeaderT.class); mi1.addMessagePart(mpi); mpi = new MessagePartInfo(new QName("", "D"), null); mpi.setTypeClass(OutHeaderT.class); mi2.addMessagePart(mpi); match = ColocUtil.isSameMessageInfo(mi1, mi2); assertFalse("Should not find a match", match); mpi.setTypeClass(InHeaderT.class); match = ColocUtil.isSameMessageInfo(mi1, mi2); assertTrue("Should find a match", match); }