@Test public void canCreateExpanderWithMultipleTypesAndDirections() { assertNotNull( PathExpanders.forTypesAndDirections( T1, INCOMING, T2, OUTGOING, T3, BOTH ) ); } }
/** * Get a path expander representing this input. * * @return path expander. */ public PathExpander getExpander() { if (typesAndDirections.isEmpty()) { return PathExpanders.forDirection(direction == null ? Direction.BOTH : direction); } //Maybe there's a less ugly way of doing this using Neo4j APIs, who knows: if (typesAndDirections.size() == 2) { return PathExpanders.forTypeAndDirection( (RelationshipType) typesAndDirections.get(0), (Direction) typesAndDirections.get(1) ); } return PathExpanders.forTypesAndDirections( (RelationshipType) typesAndDirections.get(0), (Direction) typesAndDirections.get(1), (RelationshipType) typesAndDirections.get(2), (Direction) typesAndDirections.get(3), typesAndDirections.size() > 3 ? typesAndDirections.subList(4, typesAndDirections.size()).toArray() : new Object[0] ); }