public static List<List<Intersection>> getGroups(Board board, int player) {
		int boardSize = board.boardSize;
		int[][] intersections = board.intersections;

		List<List<Intersection>> groups = new ArrayList<>();
		for (int x = 0; x < boardSize; ++x) {
			for (int y = 0; y < boardSize; ++y) {
				if (intersections[x][y] == player) {
					Intersection intersection = Intersection.getInstance(x, y);
					boolean alreadyFound = false;
					for (List<Intersection> group : groups) {
						if (group.contains(intersection)) {
							alreadyFound = true;
							break;
						}
					}
					if (!alreadyFound) {
						groups.add(getGroup(board, x, y));
					}
				}
			}
		}

		return groups;
	}