I was in my CS class when my instructor presented me the following classes:public class UninstantiableTest {    private static Uninstantiable uninstantiable;    public static void setUninstantiable(Uninstantiable used) {        uninstantiable = used;    }    public static void main(String[] args) {        Uninstantiable.setupUninsntatiableTest();        Uninstantiable test = uninstantiable;        for (int i = 0; i <= 100; i++) {            test = test.new InstantiableWithOther(Integer.toString(i));            System.out.println(test);        }    }}public class Uninstantiable {    public static void setupUninsntatiableTest() {        UninstantiableTest.setUninstantiable(new Uninstantiable());    }    private Uninstantiable() {}    public class InstantiableWithOther extends Uninstantiable {        private String string;        public InstantiableWithOther(String string) {            this.string = string;        }        public String toString() {            return string;        }    }}I was then asked for a likely use case for a class setup like this, to which I replied For applications which you wish to grant privileges to selectively by passing objects, but he didn't seem pleased with this answer.What are the use cases (if any legitimate use cases exist) for allowing instantiation only through an existing instance of the same type?
Identifying the use case for instantiation only through existing instances
java;class design;constructors;use case;instance