I tried to enter assertTrue into code and found that i need to import junit lib.
In this code,
import static org.junit.Assert.assertTrue;
//import org.junit.Assert; with this didnt worked
public class Person implements Serializable {
// some code there
assertTrue(p2.getAge() == p.getAge());
assertTrue(p2.getName().equals(p.getName()));
}
So i tried with import org.junit.Assert;
but that asserTrue didnt worked then I tried with import static org.junit.Assert.assertTrue;
and then it works. I need explanation why need static ?