I have a Java class called Term holding polynomials like below
public Term(int c, int e) throws NegativeExponent {
if (e < 0) throw new NegativeExponent();
coef = c;
expo = (coef == 0) ? 1 : e;
}
I also have an equals method in the same class like below
@Override
public boolean equals(Object obj) {
}
I am stuck with how to code how to compare these 2 Term objects
Within my JUnit test file I am using the test below to try and test the equals method
static org.junit.Assert.*;
import org.junit.Test;
public class ConEqTest
{
private int min = Integer.MIN_VALUE;
private int max = Integer.MAX_VALUE;
@Test
public void eq01() throws TError { assertTrue(new Term(-10,0).equals(new Term(-10,0))); }