void (@NotNull List<? extends XValue> vars, String... notExpected) { List<String> actualNames = new ArrayList<>(); for (XValue each : vars) { actualNames.add(computePresentation(each).myName); } String allVariablesNames = StringUtil.join(actualNames, ", "); actualNames.retainAll(List.of(notExpected)); assertTrue("Present variables: " + StringUtil.join(actualNames, ", ") + "\nAll Variables: " + allVariablesNames, actualNames.isEmpty() ); }