class CoverageService {

    int flatIndex(List<AxisDTO> axes, int[] coordinates) {
        int index = coordinates[0];
        int multiplier = 1;
        for (int i = 1; i < coordinates.length; ++i) {
            multiplier *= axes.get(i - 1).getPoints().size();
            index += coordinates[i] * multiplier;
        }
        return index;
    }

}