What if we have no test group metrics ? you try to get MetricPlotsDtos for it anyway : plots.get(testIdParent).getMetricPlotDTOs() . It can lead to NPE.