package com.tinkerpop.pipes.util;

import com.tinkerpop.pipes.BaseTest;
import com.tinkerpop.pipes.Pipe;

import java.util.Arrays;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class ScatterPipeTest extends BaseTest {

    public void testScatterPipe() {
        Pipe scatter = new ScatterPipe();
        scatter.setStarts(Arrays.asList(Arrays.asList(1, 2, 3)));
        int counter = 0;
        while (scatter.hasNext()) {
            Object object = scatter.next();
            assertTrue(object.equals(1) || object.equals(2) || object.equals(3));
            counter++;
        }
        assertEquals(counter, 3);
    }
}


@@ -637,16 +637,363 @@
 ter, 3);
+%0A%0A        scatter.setStarts(Arrays.asList(Arrays.asList(1, 2, 3)));%0A        scatter.reset();%0A        assertEquals(1, scatter.next());%0A        scatter.setStarts(Arrays.asList(Arrays.asList(1, 2, 3)));%0A        scatter.reset();%0A        assertEquals(1, scatter.next());%0A        assertEquals(2, scatter.next());%0A        assertEquals(3, scatter.next());
 %0A    %7D%0A%7D

Test reset on scatter pipe.