Is it possible to avoid nested if
statements while I want to check if variable/object is null
and if variable/object meet some condition eg.
var obj = "test";
if (obj != null) {
if (obj.equals("test")) {
//do something;
}
}
Is it possible to do oneliner of this statement without defining own method which handle this ?