@SuppressWarnings("unchecked")
    public static void init() {
        File f = new File(CACHE_FILE_NAME);
        try {
            if (f.exists()) {
                msg("[INFO] Cache file found.");
                ObjectInputStream oin = new ObjectInputStream(
                        new FileInputStream(f));
                cache = (HashMap<String, CacheEntry>) oin.readObject();
                oin.close();
                msg("[INFO] Load cache successfully.");
            }
            else {
                msg("[INFO] Cache file not found.");
                f.createNewFile();
                msg("[INFO] Create new cache successfully.");
            }
        }
        catch (ClassNotFoundException e) {
            msg("\n[WARN] Cache file format wrong. Now query without cache.");
            cache = null;
        }
        catch (IOException e) {
            msg("\n[WARN] Unable to access cache file. Now query without cache.");
            cache = null;
        }
        if (cache == null)
            cache = new HashMap<String, CacheEntry>();
    }