public static List getWhynotJustifications(QueryIterator query, String label, KeyValueList mapping) {
    { List justifications = null;

      if (query == null) {
        query = Logic.$MOST_RECENT_QUERY$;
      }
      if (mapping == null) {
        mapping = ((KeyValueList)(Logic.$MOST_RECENT_EXPLANATION_MAPPING$.get()));
      }
      if (query == null) {
        throw ((ExplainNoQueryException)(ExplainNoQueryException.newExplainNoQueryException("There is nothing to explain.").fillInStackTrace()));
      }
      if ((!(query.partialMatchStrategy != null)) &&
          (!query.exhaustedP)) {
        throw ((ExplainQueryTrueException)(ExplainQueryTrueException.newExplainQueryTrueException("The query did not fail.").fillInStackTrace()));
      }
      query = QueryIterator.deriveJustifiedPartialQuery(query);
      justifications = query.baseControlFrame.allJustifications();
      if (label != null) {
        if (mapping != null) {
          justifications = List.list(Cons.cons(Logic.lookupJustification(mapping, label), Stella.NIL));
        }
        if (justifications.first() == null) {
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("Label `" + label + "' does not exists in the current explanation");
            throw ((ExplainNoSuchLabelException)(ExplainNoSuchLabelException.newExplainNoSuchLabelException(stream000.theStringReader()).fillInStackTrace()));
          }
        }
      }
      return (justifications);
    }
  }