Logic Testing cases and NullPointerException handling in Logic