Code example for Map

Methods: containsKey, remove

0
    } 
 
    @Implementation 
    public void cancel(String tag, int id) {
        Key key = new Key(tag, id);
        if (notifications.containsKey(key)) {
            notifications.remove(key);
        } 
    } 
 
    @Implementation 
    public void cancelAll() { 
        notifications.clear();
    } 
 
    public int size() { 
        return notifications.size();
    } 
 
    public Notification getNotification(String tag, int id) {
        return notifications.get(new Key(tag, id));