Example usage for java.util ArrayList toArray

List of usage examples for java.util ArrayList toArray

Introduction

In this page you can find the example usage for java.util ArrayList toArray.

Prototype

public Object[] toArray() 

Source Link

Document

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

Usage

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());
}