public static ABObject GetRoof (HashMap<ABObject, List<ABObject>> leftSupportee, HashMap<ABObject, List<ABObject>> rightSupportee)
	{
		List<ABObject> sameList = new ArrayList<ABObject>();
		for (ABObject ab: leftSupportee.keySet())
    	{
			List<ABObject> leftList = leftSupportee.get(ab);
			for (ABObject ab1 : rightSupportee.keySet())
			{
				List<ABObject> rightList = rightSupportee.get(ab1);
				for (int i = 0; i < leftList.size(); i++)
				{
					for (int j = 0 ; j < rightList.size(); j++)
					{
						if (leftList.get(i).id == rightList.get(j).id)
						{
							if (leftList.get(i).depth <= rightList.get(j).id)
								sameList.add(leftList.get(i));
							else
								sameList.add(rightList.get(i));
						}
					}
				}
			}
    	}
		int min = Integer.MAX_VALUE;
		ABObject roof = null;
		for (int i = 0; i < sameList.size(); i++)
		{
			ABObject x = sameList.get(i);
			if (x.depth <= min)
			{
				roof = x;
				min = x.depth;
			}
		}
		return roof;
	}