Added assertion in java file