The box can be filled with electrons each of which has a particular energy but any additional electrons must take higher energies than those already in the box. The limit of how many electrons can be added is reached when the momentum of the last electron corresponds to its moving at the speed of light. In the very hot center of an evolved star all the atoms have lost their electrons and these then correspond to the example of the electrons in the box which is defined by the gravitational field of the star. The first white dwarf star to be found was the companion to the bright star Sirius. Sirius and its companion are in mutual orbit about each other and this allows the mass of each to be found.
White dwarfs are intrinsically very faint and are thus hard to detect.
Despite this they are the end state for all medium mass stars and we thus expect that there are very many white dwarfs. The degenerate pressure in white dwarfs depends only on the star's mass and not on its temperature so that they are stable. Some energy resides in the nuclear particles which are present together with the electrons. The heat associated with the nuclear particles will gradually be radiated away and the stars will gradually cool over some billions of years. The presence of white dwarf stars in binary systems has been very important for the understanding of many violent outbursts in stellar systems.