private void doFirstStep(Vertex<Text, Text, NullWritable> vertex) {
        // First superstep is special, because we can simply look at the neighbors
        // On first step value is not set, so using id
        Text currentComponent = vertex.getId();

        for (Edge<Text, NullWritable> edge : vertex.getEdges()) {
            Text neighbor = edge.getTargetVertexId();
            if (neighbor.compareTo(currentComponent) < 0) {
                currentComponent = new Text(neighbor); // do clone since neighbor is mutable
            }
        }
        vertex.setValue(currentComponent);
        for (Edge<Text, NullWritable> edge : vertex.getEdges()) {
            Text neighbor = edge.getTargetVertexId();
            if (neighbor.compareTo(currentComponent) > 0) {
                sendMessage(neighbor, currentComponent);
            }
        }
    }