@Override
    public List<Integer> getCharCodes(int gid)
    {
        int code = getCharCode(gid);
        if (code == -1)
        {
            return null;
        }
        List<Integer> codes = null;
        if (code == Integer.MIN_VALUE)
        {
            List<Integer> mappedValues = glyphIdToCharacterCodeMultiple.get(gid);
            if (mappedValues != null)
            {
                codes = new ArrayList<>(mappedValues);
                // sort the list to provide a reliable order
                Collections.sort(codes);
            }
        }
        else
        {
            codes = Collections.singletonList(code);
        }
        return codes;
    }
@Test
    void testPDFBox5328() throws IOException
    {
        List<Integer> expectedCharCodes = Arrays.asList(19981, 63847);
        int gid = 8712;
        File fontFile = new File("target/fonts", "NotoSansSC-Regular.otf");
        OTFParser otfParser = new OTFParser(false);
        OpenTypeFont otf = otfParser.parse(new RandomAccessReadBufferedFile(fontFile));

        CmapLookup unicodeCmapLookup = otf.getUnicodeCmapLookup();
        List<Integer> charCodes = unicodeCmapLookup.getCharCodes(gid);
        Assertions.assertEquals(expectedCharCodes, charCodes);

        CmapTable cmapTable = otf.getCmap();

        CmapSubtable unicodeFullCmapTable = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_FULL);
        CmapSubtable unicodeBmpCmapTable = cmapTable.getSubtable(CmapTable.PLATFORM_UNICODE, CmapTable.ENCODING_UNICODE_2_0_BMP);

        List<Integer> unicodeBmpCharCodes = unicodeBmpCmapTable.getCharCodes(gid);
        List<Integer> unicodeFullCharCodes = unicodeFullCmapTable.getCharCodes(gid);

        Assertions.assertEquals(expectedCharCodes, unicodeBmpCharCodes);
        Assertions.assertEquals(expectedCharCodes, unicodeFullCharCodes);
    }