### Question:
PrepareRoutingSubnetworks { List<IntArrayList> findSubnetworks(PrepEdgeFilter filter) { final FlagEncoder encoder = filter.getEncoder(); final EdgeExplorer explorer = ghStorage.createEdgeExplorer(filter); int locs = ghStorage.getNodes(); List<IntArrayList> list = new ArrayList<IntArrayList>(100); final GHBitSet bs = new GHBitSetImpl(locs); for (int start = 0; start < locs; start++) { if (bs.contains(start)) continue; final IntArrayList intList = new IntArrayList(20); list.add(intList); new BreadthFirstSearch() { int tmpCounter = 0; @Override protected GHBitSet createBitSet() { return bs; } @Override protected final boolean goFurther(int nodeId) { if (tmpCounter > maxEdgesPerNode.get()) maxEdgesPerNode.set(tmpCounter); tmpCounter = 0; intList.add(nodeId); return true; } @Override protected final boolean checkAdjacent(EdgeIteratorState edge) { if (encoder.isForward(edge.getFlags()) || encoder.isBackward(edge.getFlags())) { tmpCounter++; return true; } return false; } }.start(explorer, start); intList.trimToSize(); } return list; } PrepareRoutingSubnetworks(GraphHopperStorage ghStorage, List<FlagEncoder> encoders); PrepareRoutingSubnetworks setMinNetworkSize(int minNetworkSize); PrepareRoutingSubnetworks setMinOneWayNetworkSize(int minOnewayNetworkSize); void doWork(); int getMaxSubnetworks();  }### Answer:
@Test public void testFindSubnetworks() { GraphHopperStorage g = createSubnetworkTestStorage(); PrepEdgeFilter filter = new PrepEdgeFilter(carFlagEncoder); PrepareRoutingSubnetworks instance = new PrepareRoutingSubnetworks(g, Collections.singletonList(carFlagEncoder)); List<IntArrayList> components = instance.findSubnetworks(filter); assertEquals(3, components.size()); assertEquals(Helper.createTList(0, 7, 3, 13, 5), components.get(0)); assertEquals(Helper.createTList(1, 8, 4, 2, 11, 12, 9, 15), components.get(1)); assertEquals(Helper.createTList(6, 14, 10), components.get(2)); }