### Question:
IdeaImportOrganizer implements ImportOrganizer { @Override public OrganizedImports organizeImports(List<Import> imports) { Map<PackageType, ImmutableSortedSet<Import>> partitioned = imports.stream() .collect( Collectors.groupingBy( IdeaImportOrganizer::getPackageType, TreeMap::new, toImmutableSortedSet(IdeaImportOrganizer::compareImport))); return new OrganizedImports() .addGroups( partitioned, ImmutableList.of(PackageType.NON_STATIC, PackageType.JAVAX_JAVA, PackageType.STATIC)); }  @Override OrganizedImports organizeImports(List<Import> imports);  }### Answer:
@Test public void testStaticLastOrdering() { IdeaImportOrganizer organizer = new IdeaImportOrganizer(); ImportOrganizer.OrganizedImports organized = organizer.organizeImports(IMPORTS); assertThat(organized.asImportBlock()) .isEqualTo( "import android.foo;\n" + "import com.android.blah;\n" + "import net.wilma;\n" + "import unknown.barney;\n" + "import unknown.fred;\n" + "\n" + "import javax.pong;\n" + "import java.ping;\n" + "\n" + "import static android.foo.bar;\n" + "import static com.android.blah.blah;\n" + "import static java.ping.pong;\n" + "import static javax.pong.ping;\n" + "import static net.wilma.flintstone;\n" + "import static unknown.fred.flintstone;\n"); }