void (JpsArtifact artifact, final Set<? super JpsArtifact> processed, final Set<? super JpsArtifact> result, final boolean withOutputPathOnly) { if (!processed.add(artifact)) { return; } if (!withOutputPathOnly || !StringUtil.isEmpty(artifact.getOutputPath())) { result.add(artifact); } processIncludedArtifacts(artifact, included -> collectIncludedArtifacts(included, processed, result, withOutputPathOnly)); }