### Question:
ActivityManager extends AbstractMongoManager { public static final ActivityManager getInstance() { return instance; } private  ActivityManager(); void reload(); void sendPromotionMessages(User user); static final ActivityManager getInstance(); String getActivityUrl(); void displayActivityForUser(User user); void setActivityUrl(String url, int expireSeconds); synchronized float getActivityExpRate(User user); synchronized float getActivityStrengthRate(User user); synchronized void consumeDoubleExp(User user); synchronized void setActivityExpRate(String serverId, float expRate, int expireSeconds); synchronized void setActivityStrengthRate(String serverId, float strRate, int expireSeconds); synchronized void setActivityExpRate(User user, int battleCount, float expRate, int expireSeconds); static final String KEY_ACT_URL; static final String KEY_ACT_USER; static final String KEY_ACT_EXPRATE; static final String KEY_USER_EXPRATE; static final String KEY_ACT_STRRATE; static final String KEY_USER_STRRATE; static final String FIELD_BATTLECOUNT; static final String FIELD_STRCOUNT; static final String FIELD_EXPRATE; static final String FIELD_STRRATE; static final String FIELD_SERVERID; }### Answer:
@Test public void addPromotionMessage() throws Exception { String databaseName = "babywarcfg"; String namespace = "server0001"; String collection = "promotions"; MongoDBUtil.dropCollection(databaseName, namespace, collection); Calendar startCal = Calendar.getInstance(); startCal.set(Calendar.DAY_OF_MONTH, 6); startCal.set(Calendar.HOUR_OF_DAY, 0); Calendar endCal = Calendar.getInstance(); startCal.set(Calendar.DAY_OF_MONTH, 16); startCal.set(Calendar.HOUR_OF_DAY, 0); String[] message = new String[]{ "号外：单人的雪兔副本现在可以邀请好友一起进行(等级最多差20级)，奖金会按照对雪兔的伤害程度（减血比例）划分", "我们对昨天参与元宵节猜灯谜活动的玩家进行了统计，玩家'#ff0000燃烧吧m蛋崽#000000'以117道题目的成绩勇夺第一，他将获得我们送出的100元移动充值卡！感谢大家的参与。", "以下是答对的题目数量超过10道题的玩家排名:\n", "#ff00bb玩家昵称 答对题目数量", "---------------------------------------------------", "燃烧吧m蛋崽 117\n"+ "※殇涩 114\n"+ "小米疯子 89\n"+ "张冰儿 78\n"+ "Mrwang 42\n"+ "小么子 38\n"+ "So.低调 12\n"+ "带点，小忧伤 11\n"+ "克里斯保罗 10\n"+ "尧尧小飞侠12 10\n"+ "野战军丶子画☆小骨 10\n" }; for ( int i=0; i<message.length; i++ ) { PromotionPojo tip = new PromotionPojo(); tip.setId(i); tip.setMessage(message[i]); tip.setStartMillis(startCal.getTimeInMillis()); tip.setEndMillis(endCal.getTimeInMillis()); MapDBObject dbObj = new MapDBObject(); dbObj.putAll(tip); MongoDBUtil.saveToMongo(dbObj, dbObj, databaseName, namespace, collection, true); } }