### Question:
BasicAuthCache implements AuthCache { @Override public void put(final HttpHost host, final AuthScheme authScheme) { Args.notNull(host, "HTTP host"); if (authScheme == null) { return; } if (authScheme instanceof Serializable) { try { final ByteArrayOutputStream buf = new ByteArrayOutputStream(); try (final ObjectOutputStream out = new ObjectOutputStream(buf)) { out.writeObject(authScheme); } final HttpHost key = RoutingSupport.normalize(host, schemePortResolver); this.map.put(key, buf.toByteArray()); } catch (final IOException ex) { if (LOG.isWarnEnabled()) { LOG.warn("Unexpected I/O error while serializing auth scheme", ex); } } } else { if (LOG.isDebugEnabled()) { LOG.debug("Auth scheme {} is not serializable", authScheme.getClass()); } } } BasicAuthCache(final SchemePortResolver schemePortResolver);  BasicAuthCache(); @Override void put(final HttpHost host, final AuthScheme authScheme); @Override AuthScheme get(final HttpHost host); @Override void remove(final HttpHost host); @Override void clear(); @Override String toString();  }### Answer:
@Test(expected = NullPointerException.class) public void testNullKey() throws Exception { final BasicAuthCache cache = new BasicAuthCache(); final AuthScheme authScheme = new BasicScheme(); cache.put(null, authScheme); }