question: private void checkInvalidCharForUserData ( String data , final char [ ] invalidChars ) throws InvalidArgumentException { if ( null == data ) return ; for ( char invalidChar : invalidChars ) { if ( - 1 != data . indexOf ( invalidChar ) ) { throw new InvalidArgumentException ( String . format ( "Invalid character [%c] detected! please check PrincipalManagement service API" , invalidChar ) ) ; } } }
target:  check the optional data against the set of invalid chars and throw exception if detected