Could also have used `if (certArray instanceof X509Certificate[]) {` to be absolutely certain it is the expected array type.