### Question:
MacroBlockSignatureGenerator implements BlockSignatureGenerator { @Override public byte[] generate(Block block, CMSSignedDataGeneratorParameters params) throws GeneralSecurityException, IOException { if (!isSupported(block)) { throw new IllegalArgumentException("Unsupported block [" + block.getClass().getName() + "]."); } return generator.generate(dumper.dump(block), params); }  @Override byte[] generate(Block block, CMSSignedDataGeneratorParameters params); @Override boolean isSupported(Block block);  }### Answer:
@Test public void testMacroBlockSignature() throws Exception { assertThat(signer.generate(MACRO_BLOCK, CMS_PARAMS), equalTo(BLOCK_SIGNATURE)); }
@Test public void testMacroMarkerBlockSignature() throws Exception { assertThat(signer.generate(MARKER_BLOCK, CMS_PARAMS), equalTo(BLOCK_SIGNATURE)); }
@Test public void testIncompatibleBlockSignature() throws Exception { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Unsupported block [org.xwiki.rendering.block.WordBlock]."); assertThat(signer.generate(new WordBlock("macro"), CMS_PARAMS), equalTo(BLOCK_SIGNATURE)); }