* @throws WuqispankException 
	 */
	private void removeNonContiguousEvents(List<ITraceEvent> events) {
		int firstEntry = INDEX_ERROR;
		int firstExit = INDEX_ERROR;
		int endOfWindow = INDEX_ERROR;
		int current = 0;
		
		int countDeletesBefore = UNINIT;
		int countDeletesAfter = UNINIT;
		int countOfEventsToKeep = UNINIT;
		try {
			while (current < events.size()) {
				firstExit = getIndexOfNext(EventType.EXIT,events,current);
				if (firstExit!=INDEX_ERROR) {
					firstEntry = getIndexOfPrevious(EventType.ENTRY,events,firstExit);
					if (firstEntry!=INDEX_ERROR) {
						
						//Delete 'wrapped' events _before_ the unwrapped method invocation
						countDeletesBefore = firstEntry-current;
						for(int j = 0; j < countDeletesBefore; j++)
							events.remove(current);
						
						//Reset index to account for above deletion.
						firstExit -= countDeletesBefore;

						endOfWindow = getIndexOfNext(EventType.ENTRY,events,firstExit);
						if (endOfWindow==INDEX_ERROR)
							countDeletesAfter = events.size() - (firstExit+1);
						else
							countDeletesAfter = (endOfWindow-firstExit)-1;
						
						/**
						 * Delete 'wrapped' events _after_ the unwrapped method invocation
						 */
						for(int j = 0; j < countDeletesAfter; j++)
							events.remove(firstExit+1);
						
						current = firstExit + 1;
					}
				}
			}
		} catch(Exception ex) {
			ex.printStackTrace();
			StringBuilder sb = new StringBuilder();
			sb.append("\n"  + ex.getMessage() + "\n");
			sb.append("firstEntry [" + firstEntry + "]\n");
			sb.append("firstExit [" + firstExit + "]\n");
			sb.append("endOfWindow [" + endOfWindow + "]\n");
			sb.append("current [" + current + "]\n");
			sb.append("countDeletesBefore [" + countDeletesBefore + "]\n");
			sb.append("countDeletesAfter [" + countDeletesAfter + "]\n");
			sb.append("countOfEventsToKeep [" + countOfEventsToKeep + "]\n");
			throw new RuntimeException("InTrace Event Order error.  [" + sb.toString() + "]");
		}
		
		
	}