Author: rwhitcomb Date: Mon Apr 23 20:01:31 2018 New Revision: 1829939 URL: http://svn.apache.org/viewvc?rev=1829939&view=rev Log: PIVOT-999: Add two new default methods to Dictionary: * containsAny(K...) that will check if any of the given keys are in the dictionary. * getFirst(K...) that will retrieve the first value for which "containsKey" is true.
Add more tests of these new methods to DictionaryTest. Modified: pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java Modified: pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java URL: http://svn.apache.org/viewvc/pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java?rev=1829939&r1=1829938&r2=1829939&view=diff ============================================================================== --- pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java (original) +++ pivot/trunk/core/test/org/apache/pivot/collections/test/DictionaryTest.java Mon Apr 23 20:01:31 2018 @@ -60,8 +60,12 @@ public class DictionaryTest { map.put("one", 1); map.put("two", 2); map.put("three", 300); + assertEquals(map.containsAny("a", "b", "one"), true); Integer first = map.getFirst("c", "d", "two"); assertEquals(first.intValue(), 2); + + assertEquals(map.containsAny("a", "b", "c", "d"), false); + assertEquals(map.getFirst("e", "f"), null); } }