publicclassBextendsA{publicstaticvoidmain(String[]args){Bb=newB();if(b.getClass().getInterfaces().length>0){thrownewRuntimeException("B should not implement any interfaces: "+b.getClass().getInterfaces()[0].toString());}if(!(binstanceofjava.io.Serializable)){thrownewRuntimeException("B should be serializable! Inherited from A");}}}