/** * Calculate the maximum read length from the given list of reads. * * @param reads list of reads * @return non-negative integer */ public static int getMaxReadLength(final List<GATKRead> reads) { if (reads == null) { throw new IllegalArgumentException("Attempting to check a null list of reads."); } int maxReadLength = 0; for (final GATKRead read : reads) { maxReadLength = Math.max(maxReadLength, read.getLength()); } return maxReadLength; }