### Question:
MasterSlaveContextImpl implements MasterSlaveContext { @Override public void useMaster() { for (String name : masterSlaveJdbcManagerFactoryNames) { useMaster(name); } }  S2Container getContainer(); void setContainer(S2Container container); @Override void useMaster(); @Override void useMaster(String name); @Override void useSlave(); @Override void useSlave(String name); @Override boolean isMaster(); @Override boolean isMaster(String name); @Override boolean isSlave(); @Override boolean isSlave(String name); @Override boolean isMix(); @Override synchronized void removeCurrentSlave(); @Override void addMasterSlaveJdbcManagerFactoryName(String name); @Override List<MasterSlaveJdbcManagerFactory> getMasterSlaveJdbcManagerFactories(); @Override void setMasterSlaveExceptionHanlderClass(Class<? extends MasterSlaveExceptionHandler> handlerClass); MasterSlaveExceptionHandler getMasterSlaveExceptionHandler(String name);  }### Answer:
@Test(expected=IllegalArgumentException.class) public void useMaster_invalid_factory_name() { factory1.addSlaveJdbcManagerName("slave1"); factory2.addSlaveJdbcManagerName("slave1"); masterSlaveContext.useMaster("not exists factory"); }