Four Hundred Tests Passing

public final class Settings {
    private static final Settings INSTANCE = new Settings();
    private final Map<String, String> values = new HashMap<>();

    public static Settings get() { return INSTANCE; }
    public void set(String k, String v) { values.put(k, v); }
    public String get(String k)         { return values.get(k); }
}

The suite has 412 tests. Every one of them passes when run on its own. Run together, three fail, and which three changes when the runner shuffles the order. The cause is found: BillingTest calls Settings.get().set("currency", "EUR") in a setup method and never puts it back.

Which change removes the cause rather than the symptom?

A

Keep the singleton but make it immutable, loading every value once at startup so that no test can write to it at all.

B

Add static void resetForTests() that clears values, and call it from an @AfterEach in a shared test base class.

C

Change values to a ConcurrentHashMap so the parallel test workers stop stepping on each other.

D

Have BillingService and its peers take a Settings as a constructor parameter, let each test construct its own, and leave Settings.get() as the default wired up once at the composition root.