The following is an implementation in Java for an Android application, but the logic would apply to any language. Your definition of a Comment object will be different than mine so I left that class ...
Cuireadh roinnt torthaí i bhfolach toisc go bhféadfadh siad a bheith dorochtana duit
Taispeáin torthaí dorochtana