class CFFCharsetCID implements CFFCharset
{

    private static final String EXCEPTION_MESSAGE = "Not a Type 1-equivalent font";

    private final Map<Integer, Integer> sidOrCidToGid = new HashMap<>(250);

    // inverse
    private final Map<Integer, Integer> gidToCid = new HashMap<>();

    @Override
    public boolean isCIDFont()
    {
        return true;
    }
    
    @Override
    public void addSID(int gid, int sid, String name)
    {
        throw new IllegalStateException(EXCEPTION_MESSAGE);
    }

    @Override
    public void addCID(int gid, int cid)
    {
        sidOrCidToGid.put(cid, gid);
        gidToCid.put(gid, cid);
    }

    @Override
    public int getSIDForGID(int sid)
    {
        throw new IllegalStateException(EXCEPTION_MESSAGE);
    }

    @Override
    public int getGIDForSID(int sid)
    {
        throw new IllegalStateException(EXCEPTION_MESSAGE);
    }

    @Override
    public int getGIDForCID(int cid)
    {<FILL_FUNCTION_BODY>}

    @Override
    public int getSID(String name)
    {
        throw new IllegalStateException(EXCEPTION_MESSAGE);
    }

    @Override
    public String getNameForGID(int gid)
    {
        throw new IllegalStateException(EXCEPTION_MESSAGE);
    }

    @Override
    public int getCIDForGID(int gid)
    {
        Integer cid = gidToCid.get(gid);
        if (cid != null)
        {
            return cid;
        }
        return 0;
    }
}

        Integer gid = sidOrCidToGid.get(cid);
        if (gid == null)
        {
            return 0;
        }
        return gid;
    
<no_super_class>