class IgniteDhtPartitionsToReloadMap implements Serializable {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private Map<UUID, Map<Integer, Set<Integer>>> map;

    /**
     * @param nodeId Node ID.
     * @param cacheId Cache ID.
     * @return Collection of partitions to reload.
     */
    public synchronized Set<Integer> get(UUID nodeId, int cacheId) {
        if (map == null)
            return Collections.emptySet();

        Map<Integer, Set<Integer>> nodeMap = map.get(nodeId);

        if (nodeMap == null)
            return Collections.emptySet();

        Set<Integer> parts = nodeMap.get(cacheId);

        if (parts == null)
            return Collections.emptySet();

        return parts;
    }

    /**
     * @param nodeId Node ID.
     * @param cacheId Cache ID.
     * @param partId Partition ID.
     */
    public synchronized void put(UUID nodeId, int cacheId, int partId) {<FILL_FUNCTION_BODY>}

    /**
     * @return {@code True} if empty.
     */
    public synchronized boolean isEmpty() {
        return map == null || map.isEmpty();
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(IgniteDhtPartitionsToReloadMap.class, this);
    }
}

        if (map == null)
            map = new HashMap<>();

        Map<Integer, Set<Integer>> nodeMap = map.get(nodeId);

        if (nodeMap == null) {
            nodeMap = new HashMap<>();

            map.put(nodeId, nodeMap);
        }

        Set<Integer> parts = nodeMap.get(cacheId);

        if (parts == null) {
            parts = new HashSet<>();

            nodeMap.put(cacheId, parts);
        }

        parts.add(partId);
    
<no_super_class>