### Question:
DefaultIndex extends AbstractTree implements Index { @Override public final void update(final WriteableTransaction txn, final ByteString key, final EntryIDSet deletedIDs, final EntryIDSet addedIDs) throws StorageRuntimeException { if (isNullOrEmpty(deletedIDs) && isNullOrEmpty(addedIDs)) { return; } if (!get(txn, key).isDefined()) { return; } txn.update(getName(), key, new UpdateFunction() { @Override public ByteSequence computeNewValue(final ByteSequence oldValue) { if (oldValue != null) { EntryIDSet entryIDSet = computeEntryIDSet(key, oldValue.toByteString(), deletedIDs, addedIDs); return entryIDSet.size() == 0 ? null : toValue(entryIDSet); } else if (trusted) { if (deletedIDs != null) { logIndexCorruptError(txn, key); } if (isNotEmpty(addedIDs)) { return toValue(addedIDs); } } return null; } }); } DefaultIndex(TreeName name, State state, int indexEntryLimit, EntryContainer entryContainer); @Override String valueToString(ByteString value); @Override final Cursor<ByteString, EntryIDSet> openCursor(ReadableTransaction txn); @Override final void update(final WriteableTransaction txn, final ByteString key, final EntryIDSet deletedIDs,
      final EntryIDSet addedIDs); @Override final EntryIDSet get(ReadableTransaction txn, ByteSequence key); @Override final boolean setIndexEntryLimit(int indexEntryLimit); @Override final int getIndexEntryLimit(); @Override final synchronized void setTrusted(WriteableTransaction txn, boolean trusted); @Override final boolean isTrusted();  }### Answer:
@Test public void testEmptyIdSetAreRemoved() { put(newDefinedSet(1, 2, 3, 4)); update(newDefinedSet(1, 2, 3, 4), newDefinedSet()); assertThat(txn.read(index.getName(), valueOfUtf8("key"))).isNull(); }