private int getKPower(int priority) {
		int k = 0;

		if (priority <= POWERS_OF_TWO[0])
			k = 0;
		else if (priority > POWERS_OF_TWO[POWERS_OF_TWO.length - 1]) {
			k = POWERS_OF_TWO.length + 1;
		} else {
			for (int i = 1; i < POWERS_OF_TWO.length - 1; i++) {
				if (priority > POWERS_OF_TWO[i - 1]
						&& priority <= POWERS_OF_TWO[i]) {
					k = i;
					break;
				}
			}
		}

		return k + 1;
	}