code: private static void checkCircuit(Map<Circuit, Collection<TileRef>> circuits,
                                       MapCircuitExtractor extractor,
                                       MapTile map,
                                       Tile tile)
      {
          final Circuit circuit = extractor.getCircuit(tile);
          if (circuit != null)
          {
              final TileRef ref = new TileRef(tile);
              getTiles(circuits, circuit).add(ref);
              checkTransitionGroups(circuits, circuit, map, ref);
          }
      }
docs: Check the tile circuit and add it to circuits collection if valid.
  
  @param circuits The circuits collection.
  @param extractor The circuit extractor.
  @param map The map reference.
  @param tile The tile to check.