// 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 OptionTwo {
    public static interface InterfaceTop {
        public String getValue(String arg1);
    }
    public static interface InterfaceSub1 extends InterfaceTop {
        @Deprecated // I think this should be added
        public String getValue(String arg1);
        public String getValue(String arg1, String arg2);
    }
    public static interface InterfaceSub2 extends InterfaceTop {
    }
    public static class ClassImpl1 implements InterfaceSub1 {
        @Override
        public String getValue(String arg1) {
            throw new UnsupportedOperationException("Missing argument");
        }

        @Override
        public String getValue(String arg1, String arg2) {
            return arg1 + arg2;
        }
    }
    public static class ClassImpl2 implements InterfaceSub2 {
        @Override
        public String getValue(String arg1) {
            return arg1;
        }
    }
    public static void main(String[] args) {
        InterfaceSub1 i1 = new ClassImpl1();
        System.out.println(i1.getValue("ABC", "DEF"));
        InterfaceSub2 i2 = new ClassImpl2();
        System.out.println(i2.getValue("ABC"));
    }
}
