### Question:
VersionAwareHandler extends NamespaceAwareNestedTagHandler { protected void validateVersion(Attributes attributes, String[] supportedVersions) { String version = attributes.getValue("project-version"); if(Arrays.binarySearch(supportedVersions, version) < 0) { throw new CayenneRuntimeException("Unsupported project version: %s, please upgrade project using Modeler or " + "include cayenne-project-compatibility module v%s", version, LocalizedStringsHandler.getString("cayenne.version")); } } VersionAwareHandler(LoaderContext loaderContext, String rootTag);   }### Answer:
@Test public void validateCorrectVersion() { handler.validateVersion(createAttributesWithVersion("9"), VERSION_SET_1); handler.validateVersion(createAttributesWithVersion("10"), VERSION_SET_1); handler.validateVersion(createAttributesWithVersion("11"), VERSION_SET_1); handler.validateVersion(createAttributesWithVersion("10"), VERSION_SET_2); }
@Test(expected = CayenneRuntimeException.class) public void validateIncorrectVersion1() { handler.validateVersion(createAttributesWithVersion("8"), VERSION_SET_1); }
@Test(expected = CayenneRuntimeException.class) public void validateIncorrectVersion2() { handler.validateVersion(createAttributesWithVersion("11"), VERSION_SET_2); }