<s>[INST] class Arithmatic {
    int n1, n2, result;

    public void setValues(int a, int b) {
        this.n1 = a;
        this.n2 = b;
    }
    public void calculate(int ch) {
        if(ch==1) {
            result = n1+n2;
        }
        else if(ch==2) {
            result = n1-n2;
        }
        else if(ch==3) {
            result = n1*n2;
        }
        else if(ch==4) {
            if(n2 != 0)
                result = n1/n2;
            else
                result = 0;
        }
    }
    public void display() {
        System.out.println("The result is: " + result);
    }
}
class Main {
    public static void main(String[] args) {
        Arithmatic a = new Arithmatic();
        a.setValues(10, 2);
        a.calculate(1);
        a.display();
    }
}

class ArithmaticTest {
    public static void main(String[] args) {
        Arithmatic a = new Arithmatic();
        Arithmatic b = new Arithmatic();
        a.setValues(10, 2);
        b.setValues(5, 3);
        a.calculate(1);
        a.display();
        b.calculate(2);
        b.display();
    }
}

Here are the Test Cases:
Test Case 1: 
Input: a.setValues(10, 2); a.calculate(1);
Expected Output: The result is: 12

Test Case 2: 
Input: a.setValues(10, 0); a.calculate(4);
Expected Output: The result is: 0

Test Case 3: 
Input: a.setValues(5, 3); a.calculate(2);
Expected Output: The result is: 2

Test Case 4: 
Input: a.setValues(10, 2); a.calculate(3);
Expected Output: The result is: 20

Test Case 5: 
Input: a.setValues(10, 2); a.calculate(5);
Expected Output: The result is: 0 (Changing the system to print error when the input is not available)

Now we have the Arithmatic class and its functionality is working properly. But now we have to improve the performance of this class so that if there are many objects created of the Arithmatic class then also the Arithmatic class should not create many copies of the methods. And we can achieve this by using the Static methods.

Let me know if this is the right approach to improve the performance?[/INST]