void isValidGlobalNamed(String name) { FormattingErrorReporter errorReporter = new FormattingErrorReporter(); GlobalNode globalNode = (GlobalNode) expressionParser(errorReporter).parseExpression(); if (!errorReporter.getErrorMessages().isEmpty()) { fail("is valid global", errorReporter.getErrorMessages()); } String actualName = globalNode.getName(); if (!actualName.equals(name)) { failWithBadResults("is global named", name, "has name", actualName); } String actualSourceString = globalNode.toSourceString(); if (!actualSourceString.equals(name)) { failWithBadResults("is global named", name, "has source string", actualSourceString); } }