Is it possible, in Java, to enforce that a class have a specific set of subclasses and no others? For example:
public abstract class A {}
public final class B extends A {}
public final class C extends A {}
public final class D extends A {}
Can I somehow enforce that no other subclasses of A can ever be created?