private int lastIndexOf(Object element) {
    if (size == 0) {
      return -1;
    }

    int n = last;
    int index = size;
    if (element == null) {
      // Find first NULL
      do {
	if (n > 0) {
	  n--;
	} else {
	  n = queueData.length - 1;
	}
	index--;

	if (queueData[n] == null) {
	  return index;
	}
      } while (index > 0);

    } else {
      do {
	if (n > 0) {
	  n--;
	} else {
	  n = queueData.length - 1;
	}
	index--;
	if (element.equals(queueData[n])) {
	  return index;
	}
      } while (index > 0);
    }
    return -1;
  }