added assertInstanceof in tests