void () { myModel.selectScheme(myModel.getProjectScheme(), null); assertTrue(myModel.isUsePerProjectSettings()); myModel.apply(); CodeStyleSettings defaultSettings = CodeStyle.createTestSettings(); CodeStyleScheme projectScheme = myModel.getProjectScheme(); assertEquals(defaultSettings.getDefaultRightMargin(), projectScheme.getCodeStyleSettings().getDefaultRightMargin()); CodeStyleScheme scheme = myModel.createNewScheme("New Scheme", myModel.getSelectedScheme()); CodeStyleSettings settings = scheme.getCodeStyleSettings(); settings.setDefaultRightMargin(66); myModel.copyToProject(scheme); CodeStyleSettings currentSettings = CodeStyle.getSettings(getProject()); assertEquals(66, currentSettings.getDefaultRightMargin()); }