### Question:
UserActionManager { public void addUserAction(UserAction userAction) { if ( ENABLE ) { Jedis jedis = JedisFactory.getJedis(); jedis.lpush(REDIS_KEY, userAction.toString()); jedis.ltrim(REDIS_KEY, 0, MAX); } } private  UserActionManager(); static final UserActionManager getInstance(); void addUserAction(UserAction userAction); void addUserAction(String roleName, UserActionKey actionKey); void addUserAction(String roleName, UserActionKey actionKey, String param); void addUserAction(String roleName, UserActionKey actionKey, String param1, String param2); ArrayList<String> getUserActions(int limit);  }### Answer:
@Test public void testAddUserAction() { int max=1000; UserActionManager manager = UserActionManager.getInstance(); for ( int i=0; i<max; i++ ) { UserAction userAction = new UserAction(); userAction.setTextKey(UserActionKey.values()[MathUtil.nextFakeInt(UserActionKey.values().length)]); userAction.setRoleName("user"+i); manager.addUserAction(userAction); } ArrayList<String> userActions = manager.getUserActions(max); assertTrue(userActions.size()<=101); for ( String action: userActions ) { System.out.println(action); } }