public static int[] getTopBins(int[] bins, int binCount, int collapseBins){
		int[] topBins = new int[binCount];
		List<Integer> sortedBins = new ArrayList<Integer>();
		Map<Integer, List<Integer>> binCountMap = new HashMap<Integer, List<Integer>>();
		for(int i = 0; i < bins.length; ++i){
			if(!binCountMap.containsKey(bins[i])){
				binCountMap.put(bins[i], new ArrayList<Integer>());
			}
			binCountMap.get(bins[i]).add(i);
			sortedBins.add(bins[i]);
		}
		Collections.sort(sortedBins);
		Collections.reverse(sortedBins); // sort descending
		
		Set<Integer> countedBins = new HashSet<Integer>();
		int i = 0;
		int j = 0;
		while(i < binCount && j < sortedBins.size()){
			int binValue = sortedBins.get(j++);
			int binIndex = binCountMap.get(binValue).remove(0);
			if(!countedBins.contains(binIndex)){
				topBins[i++] = binIndex;
				countedBins.add(binIndex);
				// Add the other ones to ignore
				for(int b = 1; b < collapseBins / 2; b++){
					if(binIndex + b < bins.length){
						countedBins.add(binIndex + b);
					}
					if(binIndex - b >= 0){
						countedBins.add(binIndex - b);
					}
				}
			}
		}
		return topBins;
	}