### Question:
TagNamePatternSvnRevisionLink extends AbstractTagBasedSvnRevisionLink<TagPattern> { @Override protected Optional<String> getBuildName(TagPattern data, String tagName) { if (data.isValidTagName(tagName)) { return data.getBuildNameFromTagName(tagName); } else { return Optional.empty(); } } @Autowired  TagNamePatternSvnRevisionLink(SVNService svnService, StructureService structureService); @Override String getId(); @Override String getName(); @Override TagPattern clone(TagPattern data, Function<String, String> replacementFunction); @Override TagPattern parseData(JsonNode node); @Override JsonNode toJson(TagPattern data); @Override Form getForm(); @Override boolean isValidBuildName(TagPattern data, String name);  }### Answer:
@Test public void getBuildNameFromValidTag() { Optional<String> o = link.getBuildName(new TagPattern("11.8.4.*"), "11.8.4.0-5"); assertTrue(o.isPresent()); assertEquals("11.8.4.0-5", o.get()); }
@Test public void getBuildNameFromInvalidTag() { Optional<String> o = link.getBuildName(new TagPattern("11.8.4.*"), "11.8.5.0-10"); assertFalse(o.isPresent()); }