### Question:
PrepareRoutingSubnetworks { int removeDeadEndUnvisitedNetworks( final PrepEdgeFilter bothFilter ) { final EdgeFilter outFilter = new DefaultEdgeFilter(bothFilter.getEncoder(), false, true); List<TIntArrayList> components = new TarjansStronglyConnectedComponentsAlgorithm(ghStorage, outFilter). findComponents(); return removeEdges(bothFilter, components, minOneWayNetworkSize); } PrepareRoutingSubnetworks( GraphHopperStorage ghStorage, Collection<FlagEncoder> encoders ); PrepareRoutingSubnetworks setMinNetworkSize( int minNetworkSize ); PrepareRoutingSubnetworks setMinOneWayNetworkSize( int minOnewayNetworkSize ); void doWork(); int getMaxSubnetworks();  }### Answer:
@Test public void testRemoveDeadEndUnvisitedNetworks() { GraphHopperStorage g = createDeadEndUnvisitedNetworkStorage(em); assertEquals(11, g.getNodes()); PrepareRoutingSubnetworks instance = new PrepareRoutingSubnetworks(g, Collections.singleton(carFlagEncoder)). setMinOneWayNetworkSize(3); int removed = instance.removeDeadEndUnvisitedNetworks(new PrepEdgeFilter(carFlagEncoder)); assertEquals(3, removed); instance.markNodesRemovedIfUnreachable(); g.optimize(); assertEquals(8, g.getNodes()); }