docs: protected void _toJavaStatement(SarlAssertExpression assertExpression, ITreeAppendable appendable, boolean isReferenced) {
  		if (!assertExpression.isIsStatic() && assertExpression.getCondition() != null && isAtLeastJava8(assertExpression)) {
  			final XExpression condition = assertExpression.getCondition();
  			final LightweightTypeReference actualType = getLightweightType(condition);
  			if (actualType != null) {
  				final Boolean booleanConstant = this.sarlExpressionHelper.toBooleanPrimitiveWrapperConstant(condition);
  				if (booleanConstant != null) {
  					appendable.newLine().append("assert "); //$NON-NLS-1$
  					appendable.append(booleanConstant.toString());
  				} else {
  					// Get the local variables.
  					final Map<XVariableDeclaration, XFeatureCall> localVariables = getReferencedLocalVariable(condition, true);
  
  					final String className = appendable.declareUniqueNameVariable(assertExpression, "$AssertEvaluator$"); //$NON-NLS-1$
  
  					appendable.openScope();
  					try {
  						reassignThisInClosure(appendable, findKnownTopLevelType(Object.class, assertExpression));
  
  						appendable.newLine().append("class ").append(className).append(" {"); //$NON-NLS-1$ //$NON-NLS-2$
  						appendable.increaseIndentation().newLine();
  						appendable.append("final boolean $$result;").newLine(); //$NON-NLS-1$
  						appendable.append(className).append("("); //$NON-NLS-1$
  						boolean first = true;
  						for (final Entry<XVariableDeclaration, XFeatureCall> localVariable : localVariables.entrySet()) {
  							if (first) {
  								first = false;
  							} else {
  								appendable.append(", "); //$NON-NLS-1$
  							}
  							final JvmTypeReference localVariableType = getType(localVariable.getValue());
  							appendable.append("final ").append(toLightweight(localVariableType, assertExpression)); //$NON-NLS-1$
  							String referenceName = getReferenceName(localVariable.getValue(), appendable);
  							if (Strings.isEmpty(referenceName)) {
  								referenceName = localVariable.getKey().getName();
  							}
  							appendable.append(" ").append(referenceName); //$NON-NLS-1$
  						}
  						appendable.append(") {"); //$NON-NLS-1$
  						appendable.increaseIndentation();
  						internalToJavaStatement(condition, appendable, true);
  						appendable.newLine();
  						appendable.append("this.$$result = "); //$NON-NLS-1$
  						internalToConvertedExpression(condition, appendable, actualType);
  						appendable.append(";"); //$NON-NLS-1$
  						appendable.decreaseIndentation().newLine();
  						appendable.append("}"); //$NON-NLS-1$
  						appendable.decreaseIndentation().newLine();
  						appendable.append("}"); //$NON-NLS-1$
  						appendable.newLine();
  						appendable.append("assert new ").append(className).append("("); //$NON-NLS-1$ //$NON-NLS-2$
  						first = true;
  						for (final Entry<XVariableDeclaration, XFeatureCall> localVariable : localVariables.entrySet()) {
  							if (first) {
  								first = false;
  							} else {
  								appendable.append(", "); //$NON-NLS-1$
  							}
  							String referenceName = getReferenceName(localVariable.getValue(), appendable);
  							if (Strings.isEmpty(referenceName)) {
  								referenceName = localVariable.getKey().getName();
  							}
  							appendable.append(referenceName);
  						}
  						appendable.append(").$$result"); //$NON-NLS-1$
  					} finally {
  						appendable.closeScope();
  					}
  				}
  				if (!Strings.isEmpty(assertExpression.getMessage())) {
  					appendable.append(" : \""); //$NON-NLS-1$
  					appendable.append(Strings.convertToJavaString(assertExpression.getMessage()));
  					appendable.append("\""); //$NON-NLS-1$
  				}
  				appendable.append(";"); //$NON-NLS-1$
  			}
  		}
  	}