How can I use jUnit to test a class that uses a singleton?
问题 I am developing a simulator for a machine. It reads a file in, stores it in a string (as a binary number) to an array that is supposed to simulate the memory of a computer. Then it gets passed to an interpreter that takes gets the first element of the array, and based on the first 4 characters it gets sent to another class. An example of one of those classes is below: public class Add { private String cell; Add() { cell = null; } /** * Method that performs the operation add. */ public void