if (optLabel.isPresent() && m.productionsFor().contains(optLabel.get())) { Collection<Production> productions = mutable(m.productionsFor().get(optLabel.get()).get()); List<Term> rawArgs = lowerKList(((TermCons) child).get(1)); assert rawArgs.stream().allMatch(ProductionReference.class::isInstance); @SuppressWarnings("unchecked") List<ProductionReference> args = (List<ProductionReference>) (List) rawArgs;