### Question:
ConditionalOSMTagInspector implements ConditionalTagInspector { @Override public boolean isPermittedWayConditionallyRestricted(ReaderWay way) { return applies(way, false); } ConditionalOSMTagInspector(Calendar value, List<String> tagsToCheck,
                                      Set<String> restrictiveValues, Set<String> permittedValues);  ConditionalOSMTagInspector(List<? extends ConditionalValueParser> valueParsers, List<String> tagsToCheck,
                                      Set<String> restrictiveValues, Set<String> permittedValues, boolean enabledLogs); void addValueParser(ConditionalValueParser vp); @Override boolean isRestrictedWayConditionallyPermitted(ReaderWay way); @Override boolean isPermittedWayConditionallyRestricted(ReaderWay way);  }### Answer:
@Test public void testConditionalAccept() { Calendar cal = getCalendar(2014, Calendar.MARCH, 10); ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues()); ReaderWay way = new ReaderWay(1); way.setTag("vehicle:conditional", "no @ (Aug 10-Aug 14)"); assertFalse(acceptor.isPermittedWayConditionallyRestricted(way)); }
@Test public void testConditionalAcceptNextYear() { Calendar cal = getCalendar(2014, Calendar.MARCH, 10); ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues()); ReaderWay way = new ReaderWay(1); way.setTag("vehicle:conditional", "no @ (2013 Mar 1-2013 Mar 31)"); assertFalse(acceptor.isPermittedWayConditionallyRestricted(way)); }
@Test public void testConditionalReject() { Calendar cal = getCalendar(2014, Calendar.MARCH, 10); ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues()); ReaderWay way = new ReaderWay(1); way.setTag("vehicle:conditional", "no @ (Mar 10-Aug 14)"); assertTrue(acceptor.isPermittedWayConditionallyRestricted(way)); }
@Test public void testConditionalAllowanceReject() { Calendar cal = getCalendar(2014, Calendar.MARCH, 10); ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues()); ReaderWay way = new ReaderWay(1); way.setTag("vehicle:conditional", "no @ (Mar 10-Aug 14)"); assertTrue(acceptor.isPermittedWayConditionallyRestricted(way)); }
@Test public void testConditionalSingleDay() { Calendar cal = getCalendar(2015, Calendar.DECEMBER, 27); ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues()); ReaderWay way = new ReaderWay(1); way.setTag("vehicle:conditional", "no @ (Su)"); assertTrue(acceptor.isPermittedWayConditionallyRestricted(way)); }