### Question:
ConditionalParser { public boolean checkCondition(String conditionalTag) throws ParseException { if (conditionalTag == null || conditionalTag.isEmpty() || !conditionalTag.contains("@")) return false; if (conditionalTag.contains(";")) { if (enabledLogs) logger.warn("We do not support multiple conditions yet: " + conditionalTag); return false; } String[] conditionalArr = conditionalTag.split("@"); if (conditionalArr.length != 2) throw new IllegalStateException("could not split this condition: " + conditionalTag); String restrictiveValue = conditionalArr[0].trim(); if (!restrictedTags.contains(restrictiveValue)) return false; String conditionalValue = conditionalArr[1]; conditionalValue = conditionalValue.replace('(', ' '); conditionalValue = conditionalValue.replace(')', ' '); conditionalValue = conditionalValue.trim(); for (ConditionalValueParser valueParser : valueParsers) { ConditionalValueParser.ConditionState c = valueParser.checkCondition(conditionalValue); if (c.isValid()) return c.isCheckPassed(); } return false; } ConditionalParser(Set<String> restrictedTags);  ConditionalParser(Set<String> restrictedTags, boolean enabledLogs); static ConditionalValueParser createNumberParser(final String assertKey, final Number obj); ConditionalParser addConditionalValueParser(ConditionalValueParser vp); ConditionalParser setConditionalValueParser(ConditionalValueParser vp); boolean checkCondition(String conditionalTag);  }### Answer:
@Test public void testParseConditional() throws ParseException { String str = "no @ (2015 Sep 1-2015 Sep 30)"; assertFalse(createParser(getCalendar(2015, Calendar.AUGUST, 31)).checkCondition(str)); assertTrue(createParser(getCalendar(2015, Calendar.SEPTEMBER, 30)).checkCondition(str)); }
@Test public void testParseAllowingCondition() throws ParseException { assertFalse(createParser(getCalendar(2015, Calendar.JANUARY, 12)). checkCondition("yes @ (2015 Sep 1-2015 Sep 30)")); }
@Test public void testParsingOfLeading0() throws ParseException { assertTrue(createParser(getCalendar(2015, Calendar.DECEMBER, 2)). checkCondition("no @ (01.11. - 31.03.)")); assertTrue(createParser(getCalendar(2015, Calendar.DECEMBER, 2)). checkCondition("no @ (01.11 - 31.03)")); }