From 40d9cff7f64f543af860b8d38c4b520387596d32 Mon Sep 17 00:00:00 2001 From: Mark Davis Date: Mon, 31 Oct 2005 04:55:04 +0000 Subject: [PATCH] ICU-4700 additions for CLDRFile X-SVN-Rev: 18739 --- .../com/ibm/icu/dev/test/util/CollectionUtilities.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/icu4j/src/com/ibm/icu/dev/test/util/CollectionUtilities.java b/icu4j/src/com/ibm/icu/dev/test/util/CollectionUtilities.java index 9b449dcb36..577927bddc 100644 --- a/icu4j/src/com/ibm/icu/dev/test/util/CollectionUtilities.java +++ b/icu4j/src/com/ibm/icu/dev/test/util/CollectionUtilities.java @@ -21,6 +21,9 @@ import com.ibm.icu.text.UTF16; import com.ibm.icu.text.UnicodeSet; import com.ibm.icu.text.UnicodeSetIterator; +/** + * Utilities that ought to be on collections, but aren't + */ public final class CollectionUtilities { /** * Utility like Arrays.asList() @@ -36,6 +39,13 @@ public final class CollectionUtilities { return target; } + public static Collection addAll(Collection target, Iterator source) { + while (source.hasNext()) { + target.add(source.next()); + } + return target; // for chaining + } + public static Map asMap(Object[][] source) { return asMap(source, new HashMap(), false); }