In the code below I have covered one of two branches of an if statement. But I also want to test the other branch, i.e. when this.tom != null
.
public void setTom(boolean cmsConsent, boolean ebConsent) {
if(this.tom== null){
this.tom= new Tom(cmsConsent,ebConsent);
}
}
How to write assert statement so that all branches are covered?