private static ArrayList<Reading> extractReadingsForID(int trunkID, 
            ArrayList<Reading> readings)
    {
        
        int startIndex = -1, endIndex = -1; boolean end = false;
        try 
        {
        for (int i = 0; i < readings.size() && !end; i++)
        {
            if (readings.get(i).getTrunkId() == trunkID)
            {
                if (startIndex == -1)
                {
                    startIndex = i;
                }
            }
            else 
            {
                if (startIndex != -1) 
                {
                    endIndex = i-1;
                    end = true;
                }
            }
        }
        
        if (endIndex == -1)
        {
            // The last trunk necessary to manually set the final index of the readings
            endIndex = readings.size() - 1;
        }
        
        return new ArrayList<Reading>(readings.subList(startIndex, endIndex + 1)); 
        }
        catch(Exception exc)
        {
            System.out.println(exc.toString());
            return null;
        }
    }