void (SimpleNode node) { if (!(node instanceof CachingSimpleNode cachingNode)) return; SimpleNode[] cached = cachingNode.getCached(); if (cached == null) return; for (SimpleNode eachChild : cached) { cleanUpCaches(eachChild); } cachingNode.cleanUpCache(); }