### Question:
ContractManagerBuilder { public ContractManager build() { if (this.genesis == null) { throw new IllegalStateException("Must set genesis"); } return new ContractManager( this.genesis, this.bundleService, this.defaultConfig, this.contractStore, this.logStore, this.systemProperties ); } private  ContractManagerBuilder(); static ContractManagerBuilder newInstance(); ContractManagerBuilder withContractStore(ContractStore contractStore); ContractManagerBuilder withLogStore(LogStore logStore); ContractManagerBuilder withSystemProperties(SystemProperties systemProperties); ContractManagerBuilder withBundleManager(BundleService bundleService); ContractManagerBuilder withDefaultConfig(DefaultConfig defaultConfig); ContractManagerBuilder withGenesis(GenesisBlock genesis); ContractManager build();  }### Answer:
@Test public void build() { DefaultConfig config = new DefaultConfig(); GenesisBlock genesis = BlockChainTestUtils.getGenesis(); SystemProperties systemProperties = BlockChainTestUtils.createDefaultSystemProperties(); BranchId branchId = genesis.getBranchId(); BlockChainStore bcStore = BlockChainStoreBuilder.newBuilder(branchId) .withDataBasePath(config.getDatabasePath()) .withProductionMode(config.isProductionMode()) .setConsensusAlgorithm(null) .setBlockStoreFactory(PbftBlockStoreMock::new) .build(); ContractStore contractStore = bcStore.getContractStore(); FrameworkConfig bootFrameworkConfig = new BootFrameworkConfig(config, branchId); FrameworkLauncher bootFrameworkLauncher = new BootFrameworkLauncher(bootFrameworkConfig); BundleService bundleService = new BundleServiceImpl(bootFrameworkLauncher.getBundleContext()); List<BranchContract> genesisContractList = genesis.getBranch().getBranchContracts(); assert genesisContractList.size() > 0; ContractManager manager = ContractManagerBuilder.newInstance() .withGenesis(genesis) .withBundleManager(bundleService) .withDefaultConfig(config) .withContractStore(contractStore) .withLogStore(bcStore.getLogStore()) .withSystemProperties(systemProperties) .build(); assert manager != null; for (ContractStatus cs : manager.searchContracts()) { log.debug("Description {}", cs.getDescription()); log.debug("Location {}", cs.getLocation()); log.debug("SymbolicName {}", cs.getSymbolicName()); log.debug("Version {}", cs.getVersion()); log.debug(Long.toString(cs.getId())); } }