static private Set<Var> getJoinVars(Collection<Binding> left,Collection<Binding> right) {
		if(left==null || right==null)
			return null;
		Set<Var> joinVars = new HashSet<Var>();
		Iterator<Var> l = left.iterator().next().vars();
		Binding r = right.iterator().next();
		while(l.hasNext()) {
			Var v = l.next();
			if(r.contains(v)) {
				joinVars.add(v);
			}
		}
		
		return joinVars;
	}