### Question:
GroundDive extends Superpower { @Override protected void activate() { move(0, 0, -20); playSound("GROUNDDIVE_SOUND", 5); spawnParticles("GROUNDDIVE_PARTICLE", 20); } GroundDive();   }### Answer:
@Test public void testActivate() throws Exception { var groundDive = new GroundDive(); var logs = tapSystemOutNormalized(groundDive::activate) .split("\n"); final var expectedSize = 3; final var log1 = logs[0].split("-")[1].trim() + " -" + logs[0].split("-")[2].trim(); final var expectedLog1 = "Move to ( 0.0, 0.0, -20.0 )"; final var log2 = getLogContent(logs[1]); final var expectedLog2 = "Play GROUNDDIVE_SOUND with volumn 5"; final var log3 = getLogContent(logs[2]); final var expectedLog3 = "Spawn 20 particle with type GROUNDDIVE_PARTICLE"; Assert.assertEquals(logs.length, expectedSize); Assert.assertEquals(log1, expectedLog1); Assert.assertEquals(log2, expectedLog2); Assert.assertEquals(log3, expectedLog3); }