PasswordComponentImpl implements PasswordComponent { @Override public void put(String dbmsName, char[] password) { requireNonNull(dbmsName); if (password == null) { passwords.remove(dbmsName); } else { passwords.put(dbmsName, password); } } PasswordComponentImpl(); @Override void put(String dbmsName, char[] password); @Override Optional<char[]> get(String dbmsName);  }
@Test void put() { assertThrows(NullPointerException.class, () -> instance.put((String) null, null)); }