public static void main(String[] args)
    {
        long startTimestamp;
        long endTimestamp;
        long totalTime;
        List<User> userList = new ArrayList();
        List<Feed> feedList = new ArrayList();
        int request = 0;
        
        Jedis jedis = new Jedis("localhost");
        jedis.connect();
        
        DataReadWriteService service = new DataReadWriteService(jedis);
        
        // Create schema
        for (int i = 0; i < Constants.UserCount; i++)
        {
            User user = new User("tinvk + " + i, i);
            userList.add(user);
            service.addUser(user);
        }
        
        for(int i = 0; i < Constants.FeedCount; i++)
        {
             // Get random owner
            int userOrder = (int) (Math.random() * Constants.UserCount);
            User user = userList.get(userOrder);
            Feed feed = new Feed(user.getUserId(), "Hello World", "Image link");
            feedList.add(feed);
            service.addFeed(feed, user);
        }
        
        // Add user like to a feed
        startTimestamp = System.currentTimeMillis();
        for (int i = 0; i < Constants.FeedCount; i++)
        {
            Feed feed = feedList.get(i);
            int userCount = (int) (Math.random() * Constants.UserCount);
            userCount = Constants.UserCount;
            request += userCount;
            for (int j = 0; j < userCount; j++)
            {
                User user = userList.get(j);
                service.addUserLike(feed.getFeedId(), user);
            }
        }
        endTimestamp = System.currentTimeMillis();
        totalTime = endTimestamp - startTimestamp;
        System.out.println("\nTest insert " + request + " records");
        System.out.println("\tTotal time: " + totalTime + "ms");
        System.out.println("\tTime per request: " + (float) totalTime / request + "ms");
        try
        {
            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("redis_test_result.txt", true)));
            out.println("\nTest insert " + request + " records");
            out.println("Total time: " + totalTime + "ms");
            out.println("Time per request: " + (float) totalTime / request + "ms");
            out.close();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        
        // Get all user like of a feed
        int feedOrder = (int) (Math.random() * Constants.FeedCount);
        Feed feed = feedList.get(feedOrder);
        startTimestamp = System.currentTimeMillis();
        List<User> userLiKeList = service.getUserLike(feed.getFeedId(), 100);
        endTimestamp = System.currentTimeMillis();
        totalTime = endTimestamp - startTimestamp;
        System.out.println("\nTest : get " + userLiKeList.size() + " user from user like list");
        System.out.println("\tTotal time: " + totalTime + "ms");
        System.out.println("\tTime per request: " + totalTime + "ms");
        try
        {
            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("redis_test_result.txt", true)));
            out.println("\nTest : get " + userLiKeList.size() + " user from user like list");
            out.println("Total time: " + totalTime + "ms");
            out.println("Time per request: " + totalTime + "ms");
            out.close();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        for (User user : userLiKeList)
        {
            System.out.printf("\nid = %s;", user.getUserId().toString());
        }
        
        jedis.close();
    }