// Path: src/main/java/com/tinkerpop/pipes/Pipe.java
// public interface Pipe<S, E> extends Iterator<E>, Iterable<E> {
// 
//     public static final String NO_PATH_MESSAGE = "Path calculations are not enabled";
// 
//     /**
//      * Set an iterator of S objects to the head (start) of the pipe.
//      *
//      * @param starts the iterator of incoming objects
//      */
//     public void setStarts(Iterator<S> starts);
// 
//     /**
//      * Set an iterable of S objects to the head (start) of the pipe.
//      *
//      * @param starts the iterable of incoming objects
//      */
//     public void setStarts(Iterable<S> starts);
// 
//     /**
//      * Returns the transformation path to arrive at the current object of the pipe.
//      *
//      * @return a List of all of the objects traversed for the current iterator position of the pipe.
//      */
//     public List getCurrentPath();
// 
//     /**
//      * Calculating paths can be an expensive operation for some pipes.
//      * This method is used to activate or deactivate the calculation of paths.
//      * The default state of a newly constructed pipe should have its path calculations disabled.
//      * An implementation of this method should be recursive whereby the starts (if a Pipe) should have this method called on it.
//      *
//      * @param enable enable path calculations
//      */
//     public void enablePath(boolean enable);
// 
//     /**
//      * A pipe may maintain state. Reset is used to remove state.
//      * The general use case for reset() is to reuse a pipe in another computation without having to create a new Pipe object.
//      * An implementation of this method should be recursive whereby the starts (if a Pipe) should have this method called on it.
//      */
//     public void reset();
// }


import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.tg.TinkerGraphFactory;
import com.tinkerpop.pipes.Pipe;
import junit.framework.TestCase;
        pipe.setStarts(graph.getVertices());
        int counter = 0;
        while (pipe.hasNext()) {
            counter++;
            Float weight = pipe.next().getProperty("weight");
            assertTrue(weight.equals(0.4f) || weight.equals(0.2f) || weight.equals(1.0f));
        }
        assertEquals(counter, 4);
    }


    public void testInEdgesWithBranchFactor() {
        Pipe<Vertex, Edge> pipe = new InEdgesPipe(1, "created");
        pipe.setStarts(graph.getVertices());
        int counter = 0;
        while (pipe.hasNext()) {
            counter++;
            Float weight = pipe.next().getProperty("weight");
            assertTrue(weight.equals(0.4f) || weight.equals(0.2f) || weight.equals(1.0f));
        }
        assertEquals(counter, 2);
    }

    public void testInWithBranchFactor2() {
        Pipe<Vertex, Edge> pipe = new InEdgesPipe(0);
        pipe.setStarts(graph.getVertices());
        assertFalse(pipe.hasNext());
    }

    public void testOutWithBranchFactor3() {
// Path: src/main/java/com/tinkerpop/pipes/Pipe.java
// public interface Pipe<S, E> extends Iterator<E>, Iterable<E> {
// 
//     public static final String NO_PATH_MESSAGE = "Path calculations are not enabled";
// 
//     /**
//      * Set an iterator of S objects to the head (start) of the pipe.
//      *
//      * @param starts the iterator of incoming objects
//      */
//     public void setStarts(Iterator<S> starts);
// 
//     /**
//      * Set an iterable of S objects to the head (start) of the pipe.
//      *
//      * @param starts the iterable of incoming objects
//      */
//     public void setStarts(Iterable<S> starts);
// 
//     /**
//      * Returns the transformation path to arrive at the current object of the pipe.
//      *
//      * @return a List of all of the objects traversed for the current iterator position of the pipe.
//      */
//     public List getCurrentPath();
// 
//     /**
//      * Calculating paths can be an expensive operation for some pipes.
//      * This method is used to activate or deactivate the calculation of paths.
//      * The default state of a newly constructed pipe should have its path calculations disabled.
//      * An implementation of this method should be recursive whereby the starts (if a Pipe) should have this method called on it.
//      *
//      * @param enable enable path calculations
//      */
//     public void enablePath(boolean enable);
// 
//     /**
//      * A pipe may maintain state. Reset is used to remove state.
//      * The general use case for reset() is to reuse a pipe in another computation without having to create a new Pipe object.
//      * An implementation of this method should be recursive whereby the starts (if a Pipe) should have this method called on it.
//      */
//     public void reset();
// }


// Path: src/test/java/com/tinkerpop/pipes/transform/InEdgesPipeTest.java
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.tg.TinkerGraphFactory;
import com.tinkerpop.pipes.Pipe;
import junit.framework.TestCase;

        pipe.setStarts(graph.getVertices());
        int counter = 0;
        while (pipe.hasNext()) {
            counter++;
            Float weight = pipe.next().getProperty("weight");
            assertTrue(weight.equals(0.4f) || weight.equals(0.2f) || weight.equals(1.0f));
        }
        assertEquals(counter, 4);
    }


    public void testInEdgesWithBranchFactor() {
        Pipe<Vertex, Edge> pipe = new InEdgesPipe(1, "created");
        pipe.setStarts(graph.getVertices());
        int counter = 0;
        while (pipe.hasNext()) {
            counter++;
            Float weight = pipe.next().getProperty("weight");
            assertTrue(weight.equals(0.4f) || weight.equals(0.2f) || weight.equals(1.0f));
        }
        assertEquals(counter, 2);
    }

    public void testInWithBranchFactor2() {
        Pipe<Vertex, Edge> pipe = new InEdgesPipe(0);
        pipe.setStarts(graph.getVertices());
        assertFalse(pipe.hasNext());
    }

    public void testOutWithBranchFactor3() {
        Pipe<Vertex, Edge> pipe = new InEdgesPipe(1);