// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class Main {
    public static void foo(Test o) {
        o.setSize(222);
    }
    public static void bar(Test o) {
        System.out.println(o.getSize());
    }
    public static void main(String[] args) {
        Test o = new TestImpl();
        foo(o);
        bar(o);
    }
}

interface Test {
    public void setSize(int size);
    public int getSize();
}

class TestImpl implements Test {
    private int size = 0;
    public void setSize(int size) {
        this.size = size;
    }
    public int getSize() {
        return this.size;
    }
}
