### Question:
ChirpTimelineEntity extends PersistentEntity<ChirpTimelineCommand, ChirpTimelineEvent, NotUsed> { private Persist addChirp(AddChirp cmd, CommandContext<Done> ctx) { return ctx.thenPersist(new ChirpAdded(cmd.chirp), evt -> { ctx.reply(Done.getInstance()); topic.publish(cmd.chirp); }); } @Inject  ChirpTimelineEntity(ChirpTopic topic); @Override Behavior initialBehavior(Optional<NotUsed> snapshotState);  }### Answer:
@Test public void testAddChirp() { ChirpTopicStub topic = new ChirpTopicStub(); PersistentEntityTestDriver<ChirpTimelineCommand, ChirpTimelineEvent, NotUsed> driver = new PersistentEntityTestDriver<>(system, new ChirpTimelineEntity(topic), "user-1"); Chirp chirp = new Chirp("user-1", "Hello, world"); PersistentEntityTestDriver.Outcome<ChirpTimelineEvent, NotUsed> outcome = driver.run(new AddChirp(chirp)); assertEquals(Done.getInstance(), outcome.getReplies().get(0)); assertEquals(chirp, ((ChirpTimelineEvent.ChirpAdded) outcome.events().get(0)).chirp); assertEquals(chirp, topic.chirps.get(0)); assertEquals(Collections.emptyList(), driver.getAllIssues()); }