### Question:
MailMessageManager { public int acquireMailCount(String list) { Jedis jedisDB = JedisFactory.getJedisDB(); Long l = jedisDB.llen(list); if ( l != null ) { return l.intValue(); } return 0; } MailMessageManager(); static final MailMessageManager getInstance(); boolean sendAdminMail(UserId toUserId, 
			String subject, String content, Reward gift); boolean sendMail(UserId fromUserId, UserId toUserId, 
			String subject, String content, Collection<Reward> gifts, boolean isAdmin); void readMail(User user, int mailIndex, MailBoxType type); boolean takeMailGift(User user, int mailIndex); void checkMail(User user); void checkSendBox(User user, Jedis jedisDB); int deleteMail(User user, int[] mailIndex, MailBoxType type); void deleteAllMail(User user, MailBoxType type); void pushValueInList(String list, String content, int maxListCount, int expireSeconds); int deleteValueInList(String list, int[] indexes); void deleteAllInList(String list); String popValueFromList(String list, int expireSeconds); int acquireMailCount(String list); final boolean pushSimpleMessage(final String roleName, 
			final String deviceToken, final String text, int expireSeconds); final Collection<String> listSimplePushMessages(final String roleName); final Map<String, Date> getIosInactiveDevices(); final MailData parseMailString(String mailMessage); static final String getMailboxName(String userName); static final String getOfflineboxName(String roleName); static final String getMailboxName(String userName, MailBoxType type);  }### Answer:
@Test public void testAcquireMailCount() throws Exception { int maxListCount = 50; int expireSeconds = 1000; String list = "mailtest"; String[] content = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" }; MailMessageManager mail = MailMessageManager.getInstance(); int count = mail.acquireMailCount(list); assertEquals(0, count); for ( int i=0; i<content.length; i++ ) { mail.pushValueInList(list, content[i], maxListCount, expireSeconds); } assertEquals(content.length, mail.acquireMailCount(list)); Jedis jedisDB = JedisFactory.getJedisDB(); int ttl = jedisDB.ttl(list).intValue(); Thread.sleep(1000); int newttl = jedisDB.ttl(list).intValue(); assertTrue("expire seconds:", newttl < ttl ); }