### Question:
AbstractMetadata implements Metadata { protected final Version checkVersionIsValid(EntityMetadata md) { return checkVersionIsValid(md.getEntitySchema().getVersion()); }  @Override Map<MetadataRole, List<String>> getMappedRoles(); void setRoleMap(Map<MetadataRole, List<String>> roleMap); static final String SEMVER_REGEX; }### Answer:
@Test public void checkVersionIsValid_Valid() { String[] values = new String[]{ "1.0.0", "1.1.0", "100.344.88999", "1.0.0-alpha", "1.0.3-SNAPSHOT", "1.0.4-100" }; for (String value : values) { Assert.assertNotNull(value, metadata.checkVersionIsValid(new Version(value, null, null))); } }
@Test public void checkVersionIsValid_Invalid() { String[] values = new String[]{ "1.0.0x", "100.344.88.999", "1.0.0.alpha", "1.0.3.SNAPSHOT", "1.0-4-100", "bob", " 1.0.0", "100", "1.0" }; for (String value : values) { try { metadata.checkVersionIsValid(new Version(value, null, null)); Assert.fail("Expected version to be invalid: " + value); } catch (UnsupportedOperationException e) { throw e; } catch (Exception e) { } } }