Is the below piece of code fine where two threads may end up modifying the TestReporter instance at the same time?
@Test
public void someTest(TestReporter testReporter) {
// do some stuff
CompletableFuture.allOf(
CompletableFuture.runAsync(() -> {
// do task A
testReporter.publishEntry("taskA", "valueA");
}),
CompletableFuture.runAsync(() -> {
// do task B
testReporter.publishEntry("taskB", "valueB");
})
).join();
}