Checkstyle - possible NPE and unneeded predicates removed

Fixed issues with the following 2 categories:

1. Removes unneeded predicates in cases where the result of the expression is always predicted
2. Removes possible NPE cases and passing of the null for varargs. 
Why removing the check on the length of ```credentials```?