// 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 IntFun
{
    public static void test(String lbl, Integer v1, Integer v2) {
        System.out.printf("%-10s %d %d : == gives %-5b, equals give %-5b\n", lbl, v1, v2, v1 == v2, v1.equals(v2));
    }
    public static void test(int v) {
        test("new", new Integer(v), new Integer(v));
        test("valueOf", Integer.valueOf(v), Integer.valueOf(v));
        test("autoboxing", v, v);
    }
    public static void main(String[] args) {
        test(100);
        test(200);
    }
}
