RelationshipTypeAndDirections { public static List<Pair<RelationshipType, Direction>> parse(String pathFilter) { List<Pair<RelationshipType, Direction>> relsAndDirs = new ArrayList<>(); if (pathFilter == null) { relsAndDirs.add(Pair.of(null, BOTH)); } else { String[] defs = pathFilter.split("\\|"); for (String def : defs) { relsAndDirs.add(Pair.of(relationshipTypeFor(def), directionFor(def))); } } return relsAndDirs; }  static String format(Pair<RelationshipType, Direction> typeAndDirection); static List<Pair<RelationshipType, Direction>> parse(String pathFilter); static Direction directionFor(String type); static RelationshipType relationshipTypeFor(String name); static final char BACKTICK; }
@Test public void parse() throws Exception { assertEquals(expected, RelationshipTypeAndDirections.parse(input)); }