public boolean hasCommonAncestor(FamilyTreeNode node1, FamilyTreeNode node2) {
		Set<FamilyTreeNode> S = new HashSet<>();
		Queue<FamilyTreeNode> Q = new LinkedList<>();
		Q.offer(node1);
		while (!Q.isEmpty()) {
			FamilyTreeNode node = Q.poll();
			if (S.contains(node))
				continue;
			S.add(node);
			for (FamilyTreeNode n : node.parents)
				Q.offer(n);
		}
		Q.offer(node2);
		Set<FamilyTreeNode> S2 = new HashSet<>();
		while (!Q.isEmpty()) {
			FamilyTreeNode node = Q.poll();
			if (S.contains(node))
				return true;
			if (S2.contains(node))
				continue;
			S2.add(node);
			for (FamilyTreeNode n : node.parents)
				Q.offer(n);
		}
		return false;
	}