class PDOptionalContentMembershipDictionary extends PDPropertyList
{
    /**
     * Creates a new optional content membership dictionary (OCMD).
     */
    public PDOptionalContentMembershipDictionary()
    {
        this.dict.setItem(COSName.TYPE, COSName.OCMD);
    }

    /**
     * Creates a new instance based on a given {@link COSDictionary}.
     * @param dict the dictionary
     */
    public PDOptionalContentMembershipDictionary(COSDictionary dict)
    {
        super(dict);
        if (!dict.getDictionaryObject(COSName.TYPE).equals(COSName.OCMD))
        {
            throw new IllegalArgumentException(
                    "Provided dictionary is not of type '" + COSName.OCMD + "'");
        }
    }

    /**
     * Get a list of optional content groups.
     * 
     * @return List of optional content groups, never null.
     */
    public List<PDPropertyList> getOCGs()
    {<FILL_FUNCTION_BODY>}

    /**
     * Set optional content groups as a list.
     * 
     * @param ocgs list of optional content groups to set.
     */
    public void setOCGs(List<PDPropertyList> ocgs)
    {
        COSArray ar = new COSArray();
        for (PDPropertyList prop : ocgs)
        {
            ar.add(prop);
        }
        dict.setItem(COSName.OCGS, ar);
    }

    /**
     * Get the visibility policy name. Valid names are AllOff, AllOn, AnyOff, AnyOn (default).
     *
     * @return the visibility policy, never null.
     */
    public COSName getVisibilityPolicy()
    {
        return dict.getCOSName(COSName.P, COSName.ANY_ON);
    }

    /**
     * Sets the visibility policy name. Valid names are AllOff, AllOn, AnyOff, AnyOn (default).
     * 
     * @param visibilityPolicy the visibility policy name
     */
    public void setVisibilityPolicy(COSName visibilityPolicy)
    {
        dict.setItem(COSName.P, visibilityPolicy);
    }
    
    //TODO support /VE some day
}

        COSBase base = dict.getDictionaryObject(COSName.OCGS);
        if (base instanceof COSDictionary)
        {
            return Collections.singletonList(PDPropertyList.create((COSDictionary) base));
        }

        if (base instanceof COSArray)
        {
            List<PDPropertyList> list = new ArrayList<>();
            COSArray ar = (COSArray) base;
            for (int i = 0; i < ar.size(); ++i)
            {
                COSBase elem = ar.getObject(i);
                if (elem instanceof COSDictionary)
                {
                    list.add(PDPropertyList.create((COSDictionary) elem));
                }
            }
            return list;
        }

        return Collections.emptyList();
    
<methods>public static org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList create(org.apache.pdfbox.cos.COSDictionary) ,public org.apache.pdfbox.cos.COSDictionary getCOSObject() <variables>protected final non-sealed org.apache.pdfbox.cos.COSDictionary dict