### Question:
BranchGroup { public void addBranch(BlockChain blockChain) { if (blockChain == null) { return; } BranchId branchId = blockChain.getBranchId(); if (branches.containsKey(branchId)) { throw new DuplicatedException(branchId.toString() + " duplicated"); } branches.put(branchId, blockChain); }  void addBranch(BlockChain blockChain); BlockChain getBranch(BranchId branchId); boolean isFullSynced(BranchId branchId); int verify(BranchId branchId, String contractVersion); Collection<BlockChain> getAllBranch(); Map<String, List<String>> addTransaction(Transaction tx); long getLastIndex(BranchId branchId); boolean isBranchExist(BranchId branchId); Collection<Transaction> getRecentTxs(BranchId branchId); Transaction getTxByHash(BranchId branchId, String id); void addBlock(ConsensusBlock block, boolean broadcast); ConsensusBlock getBlockByIndex(BranchId branchId, long index); ConsensusBlock getBlockByHash(BranchId branchId, String hash); Receipt getReceipt(BranchId branchId, String key); List<Transaction> getUnconfirmedTxs(BranchId branchId); Object query(BranchId branchId, String contractVersion, String method, JsonObject params);  }### Answer:
@Test(expected = DuplicatedException.class) public void addExistedBranch() { BlockChain exist = BlockChainTestUtils.createBlockChain(false); branchGroup.addBranch(exist); }