not throwing runtime exception when class is changed to interface