### Question:
MetaStoreSchemaInfo implements IMetaStoreSchemaInfo { @Override public boolean isVersionCompatible(String hiveVersion, String dbVersion) { hiveVersion = getEquivalentVersion(hiveVersion); dbVersion = getEquivalentVersion(dbVersion); if (hiveVersion.equals(dbVersion)) { return true; } String[] hiveVerParts = hiveVersion.split("\\."); String[] dbVerParts = dbVersion.split("\\."); if (hiveVerParts.length != 3 || dbVerParts.length != 3) { return false; } for (int i = 0; i < dbVerParts.length; i++) { int dbVerPart = Integer.parseInt(dbVerParts[i]); int hiveVerPart = Integer.parseInt(hiveVerParts[i]); if (dbVerPart > hiveVerPart) { return true; } else if (dbVerPart < hiveVerPart) { return false; } else { continue; } } return true; } MetaStoreSchemaInfo(String metastoreHome, String dbType); @Override List<String> getUpgradeScripts(String fromVersion); @Override String generateInitFileName(String toVersion); @Override String getCreateUserScript(); @Override String getMetaStoreScriptDir(); @Override String getPreUpgradeScriptName(int index, String upgradeScriptName); @Override String getHiveSchemaVersion(); @Override boolean isVersionCompatible(String hiveVersion, String dbVersion); @Override String getMetaStoreSchemaVersion(MetaStoreConnectionInfo connectionInfo);  }### Answer:
@Test public void testIsVersionCompatible() throws Exception { IMetaStoreSchemaInfo metastoreSchemaInfo = MetaStoreSchemaInfoFactory.get(MetastoreConf.newMetastoreConf()); Assert.assertTrue(metastoreSchemaInfo.isVersionCompatible("0.0.1", "0.0.1")); Assert.assertTrue(metastoreSchemaInfo.isVersionCompatible("0.0.1", "0.0.2")); Assert.assertTrue(metastoreSchemaInfo.isVersionCompatible("1.0.2", "2.0.1")); Assert.assertTrue(metastoreSchemaInfo.isVersionCompatible("0.0.9", "9.0.0")); Assert.assertTrue(metastoreSchemaInfo.isVersionCompatible("0.13.0", "0.13.1")); Assert.assertTrue(metastoreSchemaInfo.isVersionCompatible("0.13.1", "0.13.0")); Assert.assertFalse(metastoreSchemaInfo.isVersionCompatible("0.1.1", "0.1.0")); Assert.assertFalse(metastoreSchemaInfo.isVersionCompatible("4.0.1", "0.1.0")); }