private int countUntilFailed( final UndoStack<Object> stack, final long failNumber ) throws InterruptedException {
		final Object e = new Object();
		int count = 0;

		try {
			while( true ) {
				stack.add( e );
				count += 1;
				if( count > failNumber ) {
					break;
				}
			}
		}
		catch( final Throwable t ) {
			stack.clear();
			Runtime.getRuntime().gc();
			t.printStackTrace();
		}

		return count;
	}