import java.util.List; class C { List x; List y; private void foo() { newMethod(x, y); } private void newMethod(List x, List y) { if (x.isEmpty()) return; x.remove(0); y.add(str()); baz(); } private void bar() { newMethod(y, x); } private void baz() { } private String str() { return null; } }