List of usage examples for java.util ArrayList toArray
public Object[] toArray()
From source file:gobblin.ingestion.google.webmaster.UrlTriePostOrderIteratorTest.java
/** * The trie is:/*from ww w . j a v a 2 s .c o m*/ * / * 0 * 1 * 2 */ @Test public void testVerticalTrie1TraversalWithSize4() { UrlTrie trie = new UrlTrie(_property, Arrays.asList(_property + "0", _property + "01", _property + "012")); UrlTriePostOrderIterator iterator = new UrlTriePostOrderIterator(trie, 4); ArrayList<String> chars = new ArrayList<>(); while (iterator.hasNext()) { Pair<String, UrlTrieNode> next = iterator.next(); chars.add(next.getLeft()); } //the root node is a leaf node Assert.assertEquals(new String[] { _property }, chars.toArray()); }