Validate checks if the main pattern doesn't match, that a relaxed pattern may match. This relaxed pattern is optional and could be null, resulting in a NPE if the pattern doesn't match.
During testing I realized we don't return false if the pattern is not digits only until the luhn validate, and at that point we throw an exception. The proper thing would have an initial check that the card number is digits only.
Validate checks if the main pattern doesn't match, that a relaxed pattern may match. This relaxed pattern is optional and could be null, resulting in a NPE if the pattern doesn't match.
During testing I realized we don't return false if the pattern is not digits only until the luhn validate, and at that point we throw an exception. The proper thing would have an initial check that the card number is digits only.