ActionRegistry { public void unregisterAction(@NonNull String name) { if (UAStringUtil.isEmpty(name)) { return; } synchronized (actionMap) { Entry entry = getEntry(name); if (entry == null) { return; } for (String entryName : entry.getNames()) { actionMap.remove(entryName); } } }  @NonNull Entry registerAction(@NonNull Action action, @NonNull String... names); @NonNull Entry registerAction(@NonNull Class<? extends Action> clazz, @NonNull String... names); @Nullable Entry getEntry(@NonNull String name); @NonNull Set<Entry> getEntries(); void unregisterAction(@NonNull String name); void registerDefaultActions(@NonNull Context context); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void registerActions(@NonNull Context context, @XmlRes int actionsXml);  }
@Test public void testUnregisterAction() { registry.registerAction(new TestAction(), "actionName", "anotherName"); validateEntry(registry.getEntry("actionName"), "actionName", "anotherName"); registry.unregisterAction("actionName"); assertNull("Unregister should remove all names for the entry", registry.getEntry("actionName")); assertNull("Unregister should remove all names for the entry", registry.getEntry("anotherName")); }