Assertion issue

public class Testassert{ public static void main (String [] args){ System.out.println("before assert " +args[0]); assert (args[0]== "y"); System.out.println("after assert " +args[0]); } } For the program, I am always getting assertion error java.lang.AssertionError.I expect to see that error only when somthing other than "y" is passed as an argument to the program.java -ea Testassert y --- should not give any error java -ea Testassert x --- should give the error