/** Verifies that all necessary ICQ test states are supported by the implementation. */ public void testSupportedStatusSetForCompleteness() { // first create a local list containing the presence status instances // supported by the underlying implementation. Iterator<PresenceStatus> supportedStatusSetIter = operationSetPresence.getSupportedStatusSet(); List<PresenceStatus> supportedStatusSet = new LinkedList<PresenceStatus>(); while (supportedStatusSetIter.hasNext()) { supportedStatusSet.add(supportedStatusSetIter.next()); } // create a copy of the MUST status set and remove any matching status // that is also present in the supported set. List<?> requiredStatusSetCopy = (List<?>) IcqStatusEnum.icqStatusSet.clone(); requiredStatusSetCopy.removeAll(supportedStatusSet); // if we have anything left then the implementation is wrong. int unsupported = requiredStatusSetCopy.size(); assertTrue( "There are " + unsupported + " statuses as follows:" + requiredStatusSetCopy, unsupported == 0); }