diff --git a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt index d75d88b2473..b7cda2aeb85 100644 --- a/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/jet/generators/tests/GenerateTests.kt @@ -413,6 +413,7 @@ fun main(args: Array) { model("intentions/makeTypeExplicitInLambda", testMethod = "doTestMakeTypeExplicitInLambda") model("intentions/makeTypeImplicitInLambda", testMethod = "doTestMakeTypeImplicitInLambda") model("intentions/convertToForEachLoop", testMethod = "doTestConvertToForEachLoop") + model("intentions/convertToForEachFunctionCall", testMethod = "doTestConvertToForEachFunctionCall") } testClass(javaClass()) { diff --git a/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/after.kt.template b/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/after.kt.template new file mode 100644 index 00000000000..6b7453c0d01 --- /dev/null +++ b/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/after.kt.template @@ -0,0 +1,3 @@ +fun foo() { + list.forEach { x -> x.bar() } +} \ No newline at end of file diff --git a/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/before.kt.template b/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/before.kt.template new file mode 100644 index 00000000000..6986774d611 --- /dev/null +++ b/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/before.kt.template @@ -0,0 +1,5 @@ +fun foo() { + for (x in list) { + x.bar() + } +} \ No newline at end of file diff --git a/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/description.html b/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/description.html new file mode 100644 index 00000000000..5cff4968bf5 --- /dev/null +++ b/idea/resources/intentionDescriptions/ConvertToForEachFunctionCallIntention/description.html @@ -0,0 +1,5 @@ + + +This intention transforms a for loop expression into a function call to "forEach" + + \ No newline at end of file diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index e3577dcd6d9..87d65e4ca0f 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -595,7 +595,7 @@ org.jetbrains.jet.plugin.intentions.MoveLambdaOutsideParenthesesIntention Kotlin - + org.jetbrains.jet.plugin.intentions.declarations.SplitPropertyDeclarationIntention Kotlin @@ -701,6 +701,10 @@ Kotlin + + org.jetbrains.jet.plugin.intentions.ConvertToForEachFunctionCallIntention + Kotlin + ("convert.to.for.each.function.call.intention", javaClass()) { + override fun isApplicableTo(element: JetForExpression): Boolean { + return element.getLoopRange() != null && element.getLoopParameter() != null && element.getBody() != null + } + + override fun applyTo(element: JetForExpression, editor: Editor) { + fun buildStatements(statements: List): String { + return when { + statements.isEmpty() -> "" + statements.size() == 1 -> statements[0].getText() + else -> statements.fold(StringBuilder(), { acc, h -> acc.append("${h.getText()}\n") }).toString() + } + } + + fun buildReplacementBodyText(loopParameter: JetParameter, functionBodyText: String): String { + return when { + loopParameter.getTypeReference() != null -> " (${loopParameter.getText()}) -> $functionBodyText" + else -> "${loopParameter.getText()} -> $functionBodyText" + } + } + + fun buildReceiverText(element: JetForExpression): String { + val loopRange = element.getLoopRange()!! + + return when (loopRange) { + is JetOperationExpression -> "(${loopRange.getText()})" + else -> loopRange.getText() + } + } + + val body = element.getBody()!! + val loopParameter = element.getLoopParameter()!! + + val bodyText = buildReplacementBodyText(loopParameter, when (body) { + is JetBlockExpression -> buildStatements(body.getStatements()) + else -> body.getText() + }) + + element.replace(JetPsiFactory.createExpression(element.getProject(), "${buildReceiverText(element)}.forEach { $bodyText }")) + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt b/idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt new file mode 100644 index 00000000000..fe47f57dbbf --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt @@ -0,0 +1,6 @@ +// WITH_RUNTIME +fun main() { + for (x in 1 rangeTo 2) { + x + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after new file mode 100644 index 00000000000..a0deecc549e --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt.after @@ -0,0 +1,4 @@ +// WITH_RUNTIME +fun main() { + (1 rangeTo 2).forEach { x -> x } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt b/idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt new file mode 100644 index 00000000000..2302a930a8e --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt @@ -0,0 +1,8 @@ +fun foo() { + val list = 1..4 + + for (x in list) { + x + x + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt.after new file mode 100644 index 00000000000..d9117f3c55b --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt.after @@ -0,0 +1,8 @@ +fun foo() { + val list = 1..4 + + list.forEach { x -> + x + x + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt b/idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt new file mode 100644 index 00000000000..e9a407fc79a --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME +fun main() { + val list = 1..4 + + for (x: Int in list) { + x + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt.after new file mode 100644 index 00000000000..1183a23711b --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt.after @@ -0,0 +1,6 @@ +// WITH_RUNTIME +fun main() { + val list = 1..4 + + list.forEach {(x: Int) -> x } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt b/idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt new file mode 100644 index 00000000000..1f38f6daa01 --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt @@ -0,0 +1,8 @@ +fun foo() { + val list = 1..4 + val i = 0 + + for (i in list) + i + i +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt.after new file mode 100644 index 00000000000..7637a553939 --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt.after @@ -0,0 +1,7 @@ +fun foo() { + val list = 1..4 + val i = 0 + + list.forEach { i -> i } + i +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt b/idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt new file mode 100644 index 00000000000..a853de3aa30 --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt @@ -0,0 +1,7 @@ +fun foo() { + val list = 1..4 + + for (i in list) { + + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt.after new file mode 100644 index 00000000000..e0db89740d0 --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt.after @@ -0,0 +1,5 @@ +fun foo() { + val list = 1..4 + + list.forEach { i -> } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/simple.kt b/idea/testData/intentions/convertToForEachFunctionCall/simple.kt new file mode 100644 index 00000000000..59ff6299dae --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/simple.kt @@ -0,0 +1,7 @@ +fun foo() { + val list = 1..4 + + for (x in list) { + x + } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/simple.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/simple.kt.after new file mode 100644 index 00000000000..dbcdc26399f --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/simple.kt.after @@ -0,0 +1,5 @@ +fun foo() { + val list = 1..4 + + list.forEach { x -> x } +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt b/idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt new file mode 100644 index 00000000000..b0749803481 --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt @@ -0,0 +1,6 @@ +// WITH_RUNTIME +fun main() { + val list = 1..4 + + for (x: Int in list) 11 +} \ No newline at end of file diff --git a/idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt.after b/idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt.after new file mode 100644 index 00000000000..b3babbdc94a --- /dev/null +++ b/idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt.after @@ -0,0 +1,6 @@ +// WITH_RUNTIME +fun main() { + val list = 1..4 + + list.forEach {(x: Int) -> 11 } +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java b/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java index 0d1227af873..3c807bcdf24 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/AbstractCodeTransformationTest.java @@ -270,6 +270,10 @@ public abstract class AbstractCodeTransformationTest extends LightCodeInsightTes doTestIntention(path, new ConvertToForEachLoopIntention()); } + public void doTestConvertToForEachFunctionCall(@NotNull String path) throws Exception { + doTestIntention(path, new ConvertToForEachFunctionCallIntention()); + } + private void doTestIntention(@NotNull String path, @NotNull IntentionAction intentionAction) throws Exception { configureByFile(path); diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java index e4284ee6bbd..1d993fa0111 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/CodeTransformationTestGenerated.java @@ -30,7 +30,7 @@ import org.jetbrains.jet.plugin.intentions.AbstractCodeTransformationTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@InnerTestClasses({CodeTransformationTestGenerated.DoubleBangToIfThen.class, CodeTransformationTestGenerated.IfThenToDoubleBang.class, CodeTransformationTestGenerated.ElvisToIfThen.class, CodeTransformationTestGenerated.IfThenToElvis.class, CodeTransformationTestGenerated.SafeAccessToIfThen.class, CodeTransformationTestGenerated.IfThenToSafeAccess.class, CodeTransformationTestGenerated.IfToAssignment.class, CodeTransformationTestGenerated.IfToReturn.class, CodeTransformationTestGenerated.IfToReturnAsymmetrically.class, CodeTransformationTestGenerated.WhenToAssignment.class, CodeTransformationTestGenerated.WhenToReturn.class, CodeTransformationTestGenerated.AssignmentToIf.class, CodeTransformationTestGenerated.AssignmentToWhen.class, CodeTransformationTestGenerated.PropertyToIf.class, CodeTransformationTestGenerated.PropertyToWhen.class, CodeTransformationTestGenerated.ReturnToIf.class, CodeTransformationTestGenerated.ReturnToWhen.class, CodeTransformationTestGenerated.IfToWhen.class, CodeTransformationTestGenerated.WhenToIf.class, CodeTransformationTestGenerated.Flatten.class, CodeTransformationTestGenerated.Merge.class, CodeTransformationTestGenerated.IntroduceSubject.class, CodeTransformationTestGenerated.EliminateSubject.class, CodeTransformationTestGenerated.Split.class, CodeTransformationTestGenerated.Join.class, CodeTransformationTestGenerated.ConvertMemberToExtension.class, CodeTransformationTestGenerated.ReconstructedType.class, CodeTransformationTestGenerated.RemoveUnnecessaryParentheses.class, CodeTransformationTestGenerated.ReplaceWithDotQualifiedMethodCall.class, CodeTransformationTestGenerated.ReplaceWithInfixFunctionCall.class, CodeTransformationTestGenerated.RemoveCurlyBracesFromTemplate.class, CodeTransformationTestGenerated.MoveLambdaInsideParentheses.class, CodeTransformationTestGenerated.MoveLambdaOutsideParentheses.class, CodeTransformationTestGenerated.ReplaceExplicitFunctionLiteralParamWithIt.class, CodeTransformationTestGenerated.ReplaceItWithExplicitFunctionLiteralParam.class, CodeTransformationTestGenerated.RemoveBraces.class, CodeTransformationTestGenerated.AddBraces.class, CodeTransformationTestGenerated.ReplaceGetIntention.class, CodeTransformationTestGenerated.ReplaceContainsIntention.class, CodeTransformationTestGenerated.ReplaceBinaryInfixIntention.class, CodeTransformationTestGenerated.ReplaceUnaryPrefixIntention.class, CodeTransformationTestGenerated.ReplaceInvokeIntention.class, CodeTransformationTestGenerated.SimplifyNegatedBinaryExpressionIntention.class, CodeTransformationTestGenerated.ConvertNegatedBooleanSequence.class, CodeTransformationTestGenerated.ConvertNegatedExpressionWithDemorgansLaw.class, CodeTransformationTestGenerated.SwapBinaryExpression.class, CodeTransformationTestGenerated.SplitIf.class, CodeTransformationTestGenerated.ReplaceWithOperatorAssign.class, CodeTransformationTestGenerated.ReplaceWithTraditionalAssignment.class, CodeTransformationTestGenerated.SimplifyBooleanWithConstants.class, CodeTransformationTestGenerated.InsertExplicitTypeArguments.class, CodeTransformationTestGenerated.RemoveExplicitTypeArguments.class, CodeTransformationTestGenerated.ConvertAssertToIf.class, CodeTransformationTestGenerated.ConvertIfToAssert.class, CodeTransformationTestGenerated.MakeTypeExplicitInLambda.class, CodeTransformationTestGenerated.MakeTypeImplicitInLambda.class, CodeTransformationTestGenerated.ConvertToForEachLoop.class}) +@InnerTestClasses({CodeTransformationTestGenerated.DoubleBangToIfThen.class, CodeTransformationTestGenerated.IfThenToDoubleBang.class, CodeTransformationTestGenerated.ElvisToIfThen.class, CodeTransformationTestGenerated.IfThenToElvis.class, CodeTransformationTestGenerated.SafeAccessToIfThen.class, CodeTransformationTestGenerated.IfThenToSafeAccess.class, CodeTransformationTestGenerated.IfToAssignment.class, CodeTransformationTestGenerated.IfToReturn.class, CodeTransformationTestGenerated.IfToReturnAsymmetrically.class, CodeTransformationTestGenerated.WhenToAssignment.class, CodeTransformationTestGenerated.WhenToReturn.class, CodeTransformationTestGenerated.AssignmentToIf.class, CodeTransformationTestGenerated.AssignmentToWhen.class, CodeTransformationTestGenerated.PropertyToIf.class, CodeTransformationTestGenerated.PropertyToWhen.class, CodeTransformationTestGenerated.ReturnToIf.class, CodeTransformationTestGenerated.ReturnToWhen.class, CodeTransformationTestGenerated.IfToWhen.class, CodeTransformationTestGenerated.WhenToIf.class, CodeTransformationTestGenerated.Flatten.class, CodeTransformationTestGenerated.Merge.class, CodeTransformationTestGenerated.IntroduceSubject.class, CodeTransformationTestGenerated.EliminateSubject.class, CodeTransformationTestGenerated.Split.class, CodeTransformationTestGenerated.Join.class, CodeTransformationTestGenerated.ConvertMemberToExtension.class, CodeTransformationTestGenerated.ReconstructedType.class, CodeTransformationTestGenerated.RemoveUnnecessaryParentheses.class, CodeTransformationTestGenerated.ReplaceWithDotQualifiedMethodCall.class, CodeTransformationTestGenerated.ReplaceWithInfixFunctionCall.class, CodeTransformationTestGenerated.RemoveCurlyBracesFromTemplate.class, CodeTransformationTestGenerated.MoveLambdaInsideParentheses.class, CodeTransformationTestGenerated.MoveLambdaOutsideParentheses.class, CodeTransformationTestGenerated.ReplaceExplicitFunctionLiteralParamWithIt.class, CodeTransformationTestGenerated.ReplaceItWithExplicitFunctionLiteralParam.class, CodeTransformationTestGenerated.RemoveBraces.class, CodeTransformationTestGenerated.AddBraces.class, CodeTransformationTestGenerated.ReplaceGetIntention.class, CodeTransformationTestGenerated.ReplaceContainsIntention.class, CodeTransformationTestGenerated.ReplaceBinaryInfixIntention.class, CodeTransformationTestGenerated.ReplaceUnaryPrefixIntention.class, CodeTransformationTestGenerated.ReplaceInvokeIntention.class, CodeTransformationTestGenerated.SimplifyNegatedBinaryExpressionIntention.class, CodeTransformationTestGenerated.ConvertNegatedBooleanSequence.class, CodeTransformationTestGenerated.ConvertNegatedExpressionWithDemorgansLaw.class, CodeTransformationTestGenerated.SwapBinaryExpression.class, CodeTransformationTestGenerated.SplitIf.class, CodeTransformationTestGenerated.ReplaceWithOperatorAssign.class, CodeTransformationTestGenerated.ReplaceWithTraditionalAssignment.class, CodeTransformationTestGenerated.SimplifyBooleanWithConstants.class, CodeTransformationTestGenerated.InsertExplicitTypeArguments.class, CodeTransformationTestGenerated.RemoveExplicitTypeArguments.class, CodeTransformationTestGenerated.ConvertAssertToIf.class, CodeTransformationTestGenerated.ConvertIfToAssert.class, CodeTransformationTestGenerated.MakeTypeExplicitInLambda.class, CodeTransformationTestGenerated.MakeTypeImplicitInLambda.class, CodeTransformationTestGenerated.ConvertToForEachLoop.class, CodeTransformationTestGenerated.ConvertToForEachFunctionCall.class}) public class CodeTransformationTestGenerated extends AbstractCodeTransformationTest { @TestMetadata("idea/testData/intentions/branched/doubleBangToIfThen") public static class DoubleBangToIfThen extends AbstractCodeTransformationTest { @@ -4155,6 +4155,11 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/infixCall.kt"); } + @TestMetadata("parenthesizedExpression.kt") + public void testParenthesizedExpression() throws Exception { + doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/parenthesizedExpression.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { doTestConvertToForEachLoop("idea/testData/intentions/convertToForEachLoop/simple.kt"); @@ -4177,6 +4182,49 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT } + @TestMetadata("idea/testData/intentions/convertToForEachFunctionCall") + public static class ConvertToForEachFunctionCall extends AbstractCodeTransformationTest { + public void testAllFilesPresentInConvertToForEachFunctionCall() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/intentions/convertToForEachFunctionCall"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("binaryExpressionLoopRange.kt") + public void testBinaryExpressionLoopRange() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/binaryExpressionLoopRange.kt"); + } + + @TestMetadata("blockBodyExpression.kt") + public void testBlockBodyExpression() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/blockBodyExpression.kt"); + } + + @TestMetadata("iterativeElementTypeSpecified.kt") + public void testIterativeElementTypeSpecified() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/iterativeElementTypeSpecified.kt"); + } + + @TestMetadata("noCurlyBraces.kt") + public void testNoCurlyBraces() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/noCurlyBraces.kt"); + } + + @TestMetadata("noStatements.kt") + public void testNoStatements() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/noStatements.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/simple.kt"); + } + + @TestMetadata("typeAnnotatedWithNonBlockBody.kt") + public void testTypeAnnotatedWithNonBlockBody() throws Exception { + doTestConvertToForEachFunctionCall("idea/testData/intentions/convertToForEachFunctionCall/typeAnnotatedWithNonBlockBody.kt"); + } + + } + public static Test suite() { TestSuite suite = new TestSuite("CodeTransformationTestGenerated"); suite.addTestSuite(DoubleBangToIfThen.class); @@ -4236,6 +4284,7 @@ public class CodeTransformationTestGenerated extends AbstractCodeTransformationT suite.addTestSuite(MakeTypeExplicitInLambda.class); suite.addTestSuite(MakeTypeImplicitInLambda.class); suite.addTestSuite(ConvertToForEachLoop.class); + suite.addTestSuite(ConvertToForEachFunctionCall.class); return suite; } }