ExtractWalkEdges extends KorypheFunction<Walk, Iterable<Set<Edge>>> { @Override public Iterable<Set<Edge>> apply(final Walk walk) { if (null == walk) { throw new IllegalArgumentException("Walk cannot be null"); } return walk.getEdges(); }  @Override Iterable<Set<Edge>> apply(final Walk walk);  }
@Test public void shouldReturnEdgesFromWalkObject() { final Function<Walk, Iterable<Set<Edge>>> function = new ExtractWalkEdges(); final Walk walk = new Walk.Builder() .edge(EDGE_AB) .entity(ENTITY_B) .edge(EDGE_BC) .entity(ENTITY_C) .edge(EDGE_CA) .build(); final Iterable<Set<Edge>> results = function.apply(walk); assertThat(results, containsInAnyOrder(Sets.newHashSet(EDGE_AB), Sets.newHashSet(EDGE_BC), Sets.newHashSet(EDGE_CA))); }