added ifNotNull method to sample test