Static variable are transaction's attributes, and will never persist longer than that transaction. They cannot be shared between multiple execution contexts, even if they are running in parallel (like unit tests). For example, two different unit test methods run, and each has their own version of the same static variable, or each call to an execute method in a Batchable class has their own version of the same static variable. If you want to keep it simple, each time a debug log finishes (typically EXECUTION_FINISHED), all static variables are lost. In general, if you want data to persist longer than a single transaction, you need to save the data somewhere, either in platform cache, custom settings, a database record, or some form of external storage.