We concern the Joule expansion for ideal gases, where the gas is initially kept in one side of the container and the other side is evacuated. Then the partition between the two side is released, letting the gas fill the whole container.
This Wikipedia article argues that the change in internal energy of the whole system is $0$, which I agree. Then, for ideal gases, it says that as the internal energy is a function of temperature alone, the temperature must be unchanged (1).
Here is my confusion. By saying (1), the article considers the internal energy of the whole system and that of the ideal gas the same. While this is true for the final state (where the gas has filled the whole container), I don't understand how it works for the initial state (where only one half contain the gas).