Patterns { public Patterns(Parameter[] labels, Parameters options) { if (labels == null || labels.length == 0) { return; } if (options == null || options.size() == 0) { return; } for (int i = 0; i < labels.length; i++) { patterns.add(new Pattern(i, (String) options.get(labels[i]))); } Collections.sort(patterns); } Patterns(Parameter[] labels, Parameters options); boolean hasMore(); Pattern next();  }
@Test public void testPatterns() { assertTrue("Should not be empty", patterns.hasMore()); assertEquals("123", patterns.next().getValue()); assertTrue("Should not be empty", patterns.hasMore()); assertEquals("3456", patterns.next().getValue()); assertFalse("Should be empty", patterns.hasMore()); }