Nullpointer exception in test(static testing)