title: Passing multiple paramaters to forTypesAndDirections function in Neo4j
body: <p>I'm trying to pass a variable number of paired arguments to function <a href="http://neo4j.com/docs/stable/javadocs/org/neo4j/graphdb/PathExpanders.html#forTypesAndDirections%28org.neo4j.graphdb.RelationshipType,%20org.neo4j.graphdb.Direction,%20org.neo4j.graphdb.RelationshipType,%20org.neo4j.graphdb.Direction,%20java.lang.Object...%29" rel="nofollow">forTypesAndDirection</a> with little luck. Tried the way below... Any idea?</p>
  
  <pre><code>// The relationships we will follow
  RelationshipType isa = DynamicRelationshipType.withName( "is_a" );
  RelationshipType partof = DynamicRelationshipType.withName( "part_of" );
  
  Object[] relations = new Object[4];
  
  relations[0] = isa;
  relations[1] = Direction.OUTGOING;
  relations[2] = partof;
  relations[3] = Direction.OUTGOING;
  
  maxdistance = shortestDistance( node1, node2, 1000, relations );
  </code></pre>
  
  <p>...</p>
  
  <pre><code>private Integer shortestDistance( Node source, Node target, Integer depth, Object... relations ) {
  
          PathFinder&lt;org.neo4j.graphdb.Path&gt; finder = GraphAlgoFactory.shortestPath( PathExpanders.forTypesAndDirections( relations ), depth );
  
  ...
  }
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>[ERROR] ...:[441,105] method forTypesAndDirections in class org.neo4j.graphdb.PathExpanders cannot be applied to given types;
  required: org.neo4j.graphdb.RelationshipType,org.neo4j.graphdb.Direction,org.neo4j.graphdb.RelationshipType,org.neo4j.graphdb.Direction,java.lang.Object[]
  found: java.lang.Object[]
  reason: no instance(s) of type variable(s) STATE exist so that argument type java.lang.Object[] conforms to formal parameter type org.neo4j.graphdb.RelationshipType
  </code></pre>