Avodah Zarah, Chapter Five, Mishnah Six
This mishnah discusses the permissibility of wine that was in a city when a band of non-Jewish marauders enter.
1) If a band of non-Jewish marauders entered a city in a time of peace, the open casks are prohibited and the sealed are permitted;
(a) In a time of war both are permitted because they do not have the leisure to offer libations.
If the marauders enter the city in a time of peace, the assumption is that they may make libations from wine in open casks. Nevertheless, wine that is found afterwards in closed casks is permitted. The mishnah is not assuming that the marauders will not open the closed casks. After all, we have seen over and over in the previous mishnayoth that we must suspect that the non-Jews will open the casks and take from the wine. Rather the reason that the wine is permitted is that if the marauders had opened the casks they would not bother to reseal them. Unlike the non-Jews in the previous mishnah who might have attempted to be sneaky and take a drink without getting caught, the marauders have no such concern.
However, if the marauders entered the city in a time of war, all of the wine is permitted, since they are too busy making war to make a libation.