private int indexFor(final long boardConfig, final boolean isFifteenPuzzle,
			final boolean[] tilesInSubset, final int[] tilePositions) {
		if (isFifteenPuzzle) {
			int hashCode = 0;
			for (int i = this.numOfTilesMinusOne; i >= 0; --i) {
				final int tile = (int) ((boardConfig >> (i << 2)) & 0xF);
				if (tilesInSubset[tile]) {
					hashCode |= i << (tilePositions[tile] << 2);
				}
			}
			return hashCode;
		}
		return (int) boardConfig;
	}