@Test public void delete_nullName() { assertThrows(KeyEntryNotFoundException.class, () -> { storage.delete(null); }); }
@Override public void delete(String keyName) { synchronized (this) { Entries entries = load(); if (!entries.containsKey(keyName)) { throw new KeyEntryNotFoundException(); } entries.remove(keyName); save(entries); } }
DefaultKeyStorage implements KeyStorage { @Override public void delete(String keyName) { synchronized (this) { Entries entries = load(); if (!entries.containsKey(keyName)) { throw new KeyEntryNotFoundException(); } entries.remove(keyName); save(entries); } } }
DefaultKeyStorage implements KeyStorage { @Override public void delete(String keyName) { synchronized (this) { Entries entries = load(); if (!entries.containsKey(keyName)) { throw new KeyEntryNotFoundException(); } entries.remove(keyName); save(entries); } } DefaultKeyStorage();  DefaultKeyStorage(String directoryName, String fileName); }
DefaultKeyStorage implements KeyStorage { @Override public void delete(String keyName) { synchronized (this) { Entries entries = load(); if (!entries.containsKey(keyName)) { throw new KeyEntryNotFoundException(); } entries.remove(keyName); save(entries); } } DefaultKeyStorage();  DefaultKeyStorage(String directoryName, String fileName); @Override void delete(String keyName); @Override boolean exists(String keyName); @Override KeyEntry load(String keyName); @Override Set<String> names(); @Override void store(KeyEntry keyEntry); @Override KeyEntry createEntry(String name, byte[] value); @Override void update(KeyEntry keyEntry); }
DefaultKeyStorage implements KeyStorage { @Override public void delete(String keyName) { synchronized (this) { Entries entries = load(); if (!entries.containsKey(keyName)) { throw new KeyEntryNotFoundException(); } entries.remove(keyName); save(entries); } } DefaultKeyStorage();  DefaultKeyStorage(String directoryName, String fileName); @Override void delete(String keyName); @Override boolean exists(String keyName); @Override KeyEntry load(String keyName); @Override Set<String> names(); @Override void store(KeyEntry keyEntry); @Override KeyEntry createEntry(String name, byte[] value); @Override void update(KeyEntry keyEntry);  }