/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.tinkerpop.gremlin.util.iterator;

import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException;
import org.junit.Test;

import java.util.Iterator;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

/**
 * @author Stephen Mallette (http://stephen.genoprime.com)
 */
public class ArrayIteratorTest {
    @Test
    public void shouldIterateAnArray() {
        final String[] arr = new String[3];
        arr[0] = "test1";
        arr[1] = "test2";
        arr[2] = "test3";

        final Iterator<String> itty = new ArrayIterator<>(arr);
        assertEquals("test1", itty.next());
        assertEquals("test2", itty.next());
        assertEquals("test3", itty.next());

        assertFalse(itty.hasNext());
    }

    @Test(expected = FastNoSuchElementException.class)
    public void shouldThrowFastNoSuchElementException() {
        final Iterator<String> itty = new ArrayIterator<>(new String[0]);
        assertFalse(itty.hasNext());
        itty.next();
    }
}

@@ -1846,11 +1846,328 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void shouldShowElementsInToString() %7B%0A        final String%5B%5D arr = new String%5B3%5D;%0A        arr%5B0%5D = %22test1%22;%0A        arr%5B1%5D = %22test2%22;%0A        arr%5B2%5D = %22test3%22;%0A%0A        final Iterator%3CString%3E itty = new ArrayIterator%3C%3E(arr);%0A        assertEquals(%22%5Btest1, test2, test3%5D%22, itty.toString());%0A    %7D
 %0A%7D%0A

Add test for ArrayIterator.