class CoverageTableFormat2 extends CoverageTableFormat1
{
    private final RangeRecord[] rangeRecords;

    public CoverageTableFormat2(int coverageFormat, RangeRecord[] rangeRecords)
    {
        super(coverageFormat, getRangeRecordsAsArray(rangeRecords));
        this.rangeRecords = rangeRecords;
    }

    public RangeRecord[] getRangeRecords()
    {
        return rangeRecords;
    }

    private static int[] getRangeRecordsAsArray(RangeRecord[] rangeRecords)
    {<FILL_FUNCTION_BODY>}

    @Override
    public String toString()
    {
        return String.format("CoverageTableFormat2[coverageFormat=%d]", getCoverageFormat());
    }
}

        List<Integer> glyphIds = new ArrayList<>();

        for (RangeRecord rangeRecord : rangeRecords)
        {
            for (int glyphId = rangeRecord.getStartGlyphID(); glyphId <= rangeRecord.getEndGlyphID(); glyphId++)
            {
                glyphIds.add(glyphId);
            }
        }

        int[] glyphArray = new int[glyphIds.size()];

        for (int i = 0; i < glyphArray.length; i++)
        {
            glyphArray[i] = glyphIds.get(i);
        }

        return glyphArray;
    
<methods>public void <init>(int, int[]) ,public int getCoverageIndex(int) ,public int[] getGlyphArray() ,public int getGlyphId(int) ,public int getSize() ,public java.lang.String toString() <variables>private final non-sealed int[] glyphArray