public ArrayList<Term> getOverlappingTerms(String query, int start, int end){
		ArrayList<Term> overlap = new ArrayList<>();
		query = query.toLowerCase();
		if(hasTerm(query)){
			Term searchTerm = query(query);
			PageRange searchTermRange = searchTerm.getExtendedRange();
			ArrayList<Integer> searchTermPages = new ArrayList<Integer>(searchTermRange.getRanges());
			Object[] searchTermPagesFiltered = searchTermPages.toArray();
			
			//Filter unnecessary pages if the range is specified.
			if(start != 0 && end != 0){
				for(int i = 0;i < searchTermPagesFiltered.length; i++){
					if((int)searchTermPagesFiltered[i] < start || (int)searchTermPagesFiltered[i] > end){
						searchTermPages.remove(searchTermPagesFiltered[i]);
					}
				}
			}
			for(int i = 0;i < terms.size();i++){
				Term possibility = terms.get(i);
				PageRange checkRanges = possibility.getExtendedRange();
				ArrayList<Integer> checkPossibilityPages = new ArrayList<Integer>(checkRanges.getRanges());
				for(int j = 0;j < checkPossibilityPages.size();j++){
					//If a term was found with overlap.
					if(searchTermPages.contains(checkPossibilityPages.get(j))){
						//Ensure that it isn't the same term as the query.
						if(!query.equals(possibility.getTerm().toLowerCase())){
							//System.out.println("Adding "+possibility.getTerm()+" based on: "+checkPossibilityPages.get(j));
							overlap.add(possibility);
							break;
						}
					}
				}
			}
			return overlap;
		}
		return null;
	}