### Question:
HibernateToolTask { public void execute() { if (exportCfgTask != null) { exportCfgTask.getProperties().put( ExporterConstants.METADATA_DESCRIPTOR, metadataTask.createMetadataDescriptor()); exportCfgTask.execute(); } }  MetadataTask createMetadata(); ExportCfgTask createExportCfg(); ExportDdlTask createExportDdl(); void execute();  }### Answer:
@Test public void testExecute() { HibernateToolTask htt = new HibernateToolTask(); final MetadataDescriptor mdd = new MetadataDescriptor() { @Override public Properties getProperties() { return null; } @Override public Metadata createMetadata() { return null; } }; MetadataTask mdt = new MetadataTask() { @Override public MetadataDescriptor createMetadataDescriptor() { return mdd; } }; htt.metadataTask = mdt; ExportCfgTask ect = new ExportCfgTask(htt) { @Override public void execute() { testObject = getProperties().get(ExporterConstants.METADATA_DESCRIPTOR); } }; htt.exportCfgTask = ect; assertNull(testObject); htt.execute(); assertSame(testObject, mdd); }