### Question:
EditorModel { public boolean isScriptFile(File f) { if (f != null && (!f.exists() || f.isFile())) { final int lastDot = f.getName().lastIndexOf('.'); if (lastDot >= 0) { final String suffix = f.getName().substring(lastDot + 1).toLowerCase(); return s_knownScriptTypes.contains(suffix); } } return false; } EditorModel(Resources resources,
                     TextSource.Factory textSourceFactory,
                     AgentCacheState agentCacheState,
                     FileChangeWatcher fileChangeWatcher); Buffer getSelectedBuffer(); void selectNewBuffer(); Buffer selectBufferForFile(File file); Buffer getBufferForFile(File file); Buffer[] getBuffers(); boolean isABufferDirty(); void selectBuffer(Buffer buffer); void closeBuffer(final Buffer buffer); File getSelectedPropertiesFile(); void setSelectedPropertiesFile(final File selectedProperties); void addListener(Listener listener); boolean isScriptFile(File f); boolean isPropertiesFile(File f); boolean isSelectedScript(File f); boolean isBoringFile(File f); void openWithExternalEditor(final File file); void setExternalEditor(File command, String arguments);  }### Answer:
@Test public void testIsScriptFile() throws Exception { final EditorModel editorModel = new EditorModel(s_resources, new StringTextSource.Factory(), m_agentCacheState, m_fileChangeWatcher); final File[] script = { new File("my file.py"), new File(".blah.py"), new File("python.PY"), new File("~python.py"), new File("clojure.clj"), new File(".clj"), }; for (int i = 0; i < script.length; ++i) { assertTrue("Is script: " + script[i], editorModel.isScriptFile(script[i])); } final File[] notScript = { null, new File("script.python"), new File("script.py "), new File("foo.bah"), new File("x.text"), }; for (int i = 0; i < notScript.length; ++i) { assertTrue("Isn't script: " + notScript[i], !editorModel.isScriptFile(notScript[i])); } }