BytecodeCompiler extends Compiler { @Override public void compile() { this.visitProgram(this.program); this.result = this.writer.toByteArray(); this.compiled = true; } BytecodeCompiler(final Program program); @Override void compile(); void compileDebug(); @Override byte[] asByteArray();  }
@Test public void testCompile() throws Exception { Program program = new Program("Empty"); BytecodeCompiler compiler = new BytecodeCompiler(program); assertFalse(compiler.isCompiled()); assertArrayEquals(new byte[0], compiler.asByteArray()); compiler.compile(); assertTrue(compiler.isCompiled()); assertTrue(compiler.asByteArray().length > 0); }