package com.intellij.codeInsight.unwrap; public class UnwrapForTest extends UnwrapTestCase { public void testForWithStatement() throws Exception { assertUnwrapped("for(int i = 0; i < 10; i++) System.gc();\n", "int i = 0;\n" + "System.gc();\n"); } public void testForWithBlock() throws Exception { assertUnwrapped("for(int i = 0; i < 10; i++) {\n" + " System.gc();\n" + "}\n", "int i = 0;\n" + "System.gc();\n"); } public void testEmptyFor() throws Exception { assertUnwrapped("for(int i = 0; i < 10; i++);\n", "int i = 0;\n"); } public void testForEachWithStatement() throws Exception { assertUnwrapped("for(String s : strings) System.gc();\n", "System.gc();\n"); } public void testForEachWithBlock() throws Exception { assertUnwrapped("for(String s : strings) {\n" + " System.gc();\n" + "}\n", "System.gc();\n"); } }