Shape of the container and the number of possible energy states A question came up when studying the formula for calculating the total number of possible energy states of a particle within a container. 

Why is the number of possible energy states independent of the shape of the container and merely dependent on the number of states in only 3 perpendicular container dimensions ($x$, $y$ and $z$), while a momentum vector can be directed at any direction within the container? Shouldn't the length of the container in that same direction as the momentum vector also determine the number of energy states in that direction?
For a sufficiently small container, the size and shape of the system is significant, e.g. some energy states are prohibited. For example, CdTe quantum dots behave differently from the bulk material.

However, the kinetic theory is based on the assumption that, "The number of molecules is so large that statistical treatment can be applied." The momentum is treated as a vector having x, y and z components and does not depend on the shape of the container (though a cube is convenient for illustration of three orthogonal directions). The equations can be derived using spherical coordinates, and they still must integrate collisions in all directions, so are equivalent.