void () { //collection(String.class) ElementPattern pattern = collection(String.class).last(string().startsWith("abc")); assertFalse(pattern.accepts(Arrays.<String>asList())); assertTrue(pattern.accepts(Arrays.asList("abc"))); assertTrue(pattern.accepts(Arrays.asList("abc", "abcd"))); assertFalse(pattern.accepts(Arrays.asList("abc", "bcd"))); assertFalse(pattern.accepts(Arrays.asList("bc", "bcd"))); assertTrue(pattern.accepts(Arrays.asList("bc", "abc"))); }