### Question:
EditorModel { public boolean isPropertiesFile(File f) { return f != null && (!f.exists() || f.isFile()) && f.getName().toLowerCase().endsWith(".properties"); } 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 testIsPropertiesFile() throws Exception { final EditorModel editorModel = new EditorModel(s_resources, new StringTextSource.Factory(), m_agentCacheState, m_fileChangeWatcher); final File[] properties = { new File("my file.properties"), new File(".blah.properties"), new File("python.PROPERTIES"), new File("~python.properties"), }; for (int i = 0; i < properties.length; ++i) { assertTrue("Is properties: " + properties[i], editorModel.isPropertiesFile(properties[i])); } final File[] notProperties = { null, new File("script.props"), new File("script.properties "), new File("foo.bah"), new File("x.text"), }; for (int i = 0; i < notProperties.length; ++i) { assertTrue("Isn't properties: " + notProperties[i], !editorModel.isPropertiesFile(notProperties[i])); } }