### Question:
Identity implements Executor { public Executor wrapExecutor(Executor executor) { return command -> executor.execute(() -> Identity.this.execute(command)); } private  Identity(String name); static Identity get(String name); static Identity create(); @Nullable static Identity current(); String name(); boolean isCurrent(); void require(); static void require(Collection<Identity> identities); void exclude(); Executor wrapExecutor(Executor executor); ScheduledExecutorService wrapExecutor(ScheduledExecutorService executor); @Override void execute(Runnable command); @Override String toString(); static final Identity DEFAULT; }### Answer:
@Test void wrapExecutor() { assertEquals(Identity.DEFAULT, Identity.current()); Identity idFoobar = Identity.get("foobar"); Identity idBlah = Identity.get("blah"); AtomicBoolean didRun = new AtomicBoolean(false); idFoobar.wrapExecutor(Runnable::run) .execute( () -> { idFoobar.require(); idBlah.exclude(); Identity.DEFAULT.exclude(); didRun.set(true); }); assertTrue(didRun.get()); assertEquals(Identity.DEFAULT, Identity.current()); }