NullPointer replaced
optimized aggregation, fixed typos
replaced null pointer with checkNotNull
replaced null pointer with checkNotNull
replaced null pointer with checkNotNull
replaced null pointer with checkNotNull
replaced null pointer with checkNotNull
replaced null pointer with checkNotNull