removed use of java 7 apis for null check

minimal jdk is java 6