### Question:
Identity implements Executor { @Nullable public static Identity current() { Identity ret = mCurrentIdentity.get(); return ret == null ? DEFAULT : ret; } 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 current() { assertEquals(Identity.DEFAULT, Identity.current()); Identity idFoobar = Identity.get("foobar"); Identity idBlah = Identity.get("blah"); assertNotEquals(idBlah, idFoobar); idFoobar.execute(() -> assertEquals(idFoobar, Identity.current())); assertEquals(Identity.DEFAULT, Identity.current()); idBlah.execute( () -> { assertEquals(idBlah, Identity.current()); idFoobar.execute(() -> assertEquals(idFoobar, Identity.current())); try { mExecutor .submit( () -> { assertEquals(Identity.DEFAULT, Identity.current()); idFoobar.execute( () -> assertEquals( idFoobar, Identity.current())); assertEquals(Identity.DEFAULT, Identity.current()); }) .get(); } catch (Exception x) { throw new RuntimeException(x); } }); assertEquals(Identity.DEFAULT, Identity.current()); }