added null check for addAllInternal()
added test
fixed checkstyle
rebased and made some corrections
fixed failed test and solve merge conflicts
fix merge conflicts
Merge pull request #3337 from hasancelik/fixes#3330

added null check for addAllInternal() , added test