package hu.advancedweb.example;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.*;

import java.util.function.Function;

import org.junit.Test;

public class LambdaTest {

	@Test
	public void test_with_lambda() throws Exception {
		Function<String, String> generatePalindrome = input -> {
			StringBuilder sb = new StringBuilder();
			sb.append(input);
			sb.reverse();
			
			String reversed = sb.toString();
			
			String palindrome = input + reversed;
			return palindrome;
		};
		
		String word = "cat";
		
		String palindromized = generatePalindrome.apply(word);
		
		assertThat(palindromized, equalTo(word + word));
	}
	
}

@@ -653,10 +653,238 @@
 );%0A%09%7D%0A%09%0A
+%09@Test%0A%09public void lambda_with_single_expression() throws Exception %7B%0A%09%09System.out.println(%22hello%22);%0A%09%09Function%3CString, String%3E lambda = a -%3E a + a;%0A%09%09String result = lambda.apply(%221%22);%0A%09%09assertThat(result, equalTo(%222%22));%0A%09%7D%0A%09%0A
 %7D%0A

Add test case for issue #23