//TODO: Note that not all reads actually cover a given var
static int examineVar(final int var, final ArrayList<Read> list, final IntList collection, final int[] rvector, LinkedHashMap<Integer, ArrayList<Read>> map){
		collection.clear();
		for(Read r : list){
			final ReadKey rk=(ReadKey) r.obj;
			final IntList vars=rk.vars;
			for(int i=0; i<vars.size; i++){
				final int v2=vars.get(i);
				if(v2!=var){
					collection.add(v2);
				}
			}
		}
		collection.sort();
		final int varCount=list.size();
		int lastVar2=-1, bestVar2=-1;
		int sharedCount=0, bestSharedCount=0, bestDifferent=999;
		for(int i=0; i<collection.size; i++){//TODO: Note that not all reads actually cover a given var
			int currentVar2=collection.get(i);
			if(currentVar2==lastVar2){sharedCount++;}
			else{
				if(sharedCount>bestSharedCount){
					final int different1=(sharedCount==varCount ? 0 : countDifferentAlleles(lastVar2, list));
					if(different1*8<varCount){
						ArrayList<Read> list2=map.get(lastVar2);
						final int varCount2=(list2==null ? 0 : list2.size());
						final int different2=(sharedCount==varCount2 ? 0 : countDifferentAlleles(var, list2));
						if(different2*8<varCount2){
							bestVar2=lastVar2;
							bestSharedCount=sharedCount;
							bestDifferent=Tools.max(different1, different2);
						}
					}
				}
				sharedCount=1;
			}
			lastVar2=currentVar2;
		}
		if(sharedCount>bestSharedCount){
			final int different1=(sharedCount==varCount ? 0 : countDifferentAlleles(lastVar2, list));
			if(different1*8<varCount){
				ArrayList<Read> list2=map.get(lastVar2);
				final int varCount2=(list2==null ? 0 : list2.size());
				final int different2=(sharedCount==varCount2 ? 0 : countDifferentAlleles(var, list2));
				if(different2*8<varCount2){
					bestVar2=lastVar2;
					bestSharedCount=sharedCount;
					bestDifferent=Tools.max(different1, different2);
				}
			}
		}
		rvector[0]=var;
		rvector[1]=list.size();
		rvector[2]=bestVar2;
		rvector[3]=sharedCount;
		rvector[4]=bestDifferent;
		return bestVar2;
	}
int lastVar2=-1, bestVar2=-1;
int sharedCount=0, bestSharedCount=0, bestDifferent=999;
for(int i=0; i<collection.size; i++){//TODO: Note that not all reads actually cover a given var
int currentVar2=collection.get(i);
if(currentVar2==lastVar2){sharedCount++;}
final int v2=vars.get(i);
if(v2!=var){
collection.add(v2);
}
}
}
collection.sort();
final int varCount=list.size();
int lastVar2=-1, bestVar2=-1;
int sharedCount=0, bestSharedCount=0, bestDifferent=999;
for(int i=0; i<collection.size; i++){//TODO: Note that not all reads actually cover a given var
int currentVar2=collection.get(i);
if(currentVar2==lastVar2){sharedCount++;}
else{
if(sharedCount>bestSharedCount){
final int different1=(sharedCount==varCount ? 0 : countDifferentAlleles(lastVar2, list));
if(different1*8<varCount){
ArrayList<Read> list2=map.get(lastVar2);
final int varCount2=(list2==null ? 0 : list2.size());
final int different2=(sharedCount==varCount2 ? 0 : countDifferentAlleles(var, list2));
if(different2*8<varCount2){
static int examineVar(final int var, final ArrayList<Read> list, final IntList collection, final int[] rvector, LinkedHashMap<Integer, ArrayList<Read>> map){
collection.clear();
for(Read r : list){
final ReadKey rk=(ReadKey) r.obj;
final IntList vars=rk.vars;
for(int i=0; i<vars.size; i++){
final int v2=vars.get(i);
if(v2!=var){
collection.add(v2);
}
}
}
collection.sort();
final int varCount=list.size();
int lastVar2=-1, bestVar2=-1;
int sharedCount=0, bestSharedCount=0, bestDifferent=999;
for(int i=0; i<collection.size; i++){//TODO: Note that not all reads actually cover a given var
int currentVar2=collection.get(i);
if(currentVar2==lastVar2){sharedCount++;}
else{
if(sharedCount>bestSharedCount){
final int different1=(sharedCount==varCount ? 0 : countDifferentAlleles(lastVar2, list));
if(different1*8<varCount){
ArrayList<Read> list2=map.get(lastVar2);
final int varCount2=(list2==null ? 0 : list2.size());
final int different2=(sharedCount==varCount2 ? 0 : countDifferentAlleles(var, list2));
if(different2*8<varCount2){
bestVar2=lastVar2;
bestSharedCount=sharedCount;
bestDifferent=Tools.max(different1, different2);
}
}
}
sharedCount=1;
}
lastVar2=currentVar2;
}