code: public Circuit getCircuit(Tile tile)
      {
          final Collection<String> neighborGroups = getNeighborGroups(tile);
          final Collection<String> groups = new HashSet<>(neighborGroups);
          final String group = mapGroup.getGroup(tile);
          final Circuit circuit;
  
          if (groups.size() == 1)
          {
              if (group.equals(groups.iterator().next()))
              {
                  circuit = new Circuit(CircuitType.MIDDLE, group, group);
              }
              else
              {
                  circuit = new Circuit(CircuitType.BLOCK, group, groups.iterator().next());
              }
          }
          else
          {
              circuit = getCircuitGroups(group, neighborGroups);
          }
  
          return circuit;
      }
docs: Get the tile circuit.
  
  @param tile The current tile.
  @return The tile circuit, <code>null</code> if none.