class Test { void foo(Param param1) { if (param1.getI().lenght == 0) { } Param param = null; } void bar(){ foo(new Param(1, 2)); } }