ShellVariablesRegistry (@NotNull String bundleName) { Iterator<TextMatePreferences> preferences = TestUtil.readBundle(bundleName).readPreferences().iterator(); assertNotNull(preferences); ShellVariablesRegistryImpl variablesRegistry = new ShellVariablesRegistryImpl(); while (preferences.hasNext()) { for (TextMateShellVariable variable : preferences.next().getVariables()) { variablesRegistry.addVariable(variable); } } return variablesRegistry; }