01: package com.ecyrd.jspwiki;
02:
03: import java.util.*;
04:
05: /**
06: * Utilities for tests.
07: */
08: public class Util {
09: /**
10: * Check that a collection contains the required string.
11: */
12: public static boolean collectionContains(Collection container,
13: String captive) {
14: Iterator i = container.iterator();
15: while (i.hasNext()) {
16: Object cap = i.next();
17: if (cap instanceof String && captive.equals(cap))
18: return true;
19: }
20:
21: return false;
22: }
23: }
|