NullObjectInstead of returning null , use an object which implements the expected interface, but whose method body is empty.