protected ObjectArrayList<? extends GenotypeCount> getAllCounts(BaseInformationRecords.BaseInformationOrBuilder record,
boolean isTumor, boolean sort) {
ObjectArrayList<? extends GenotypeCount> cached = getCachedResult(isTumor, sort);
if (cached != null && record.equals(recordCached[isTumor ? 1 : 0][sort ? 1 : 0])) {
return cached;
} else {
assert oneSampleHasTumor(record.getSamplesList()) : "at least one sample must have hasTumor=true.";
for (int i = 0; i < record.getSamplesCount(); i++) {
if (isTumor != record.getSamples(i).getIsTumor()) continue;
cached = getAllCounts(record, getGenotypeCountFactory(), isTumor, sort);
putInCache(record, cached, isTumor, sort);
return cached;
}
throw new InternalError("At least one sample matching isTumor, and one matching not isTumor must be found.");
}
}