### Question:
DateLocale { public long matchMonth(CharSequence content, int lo, int hi) throws NumericException { return findToken(content, lo, hi, months); } DateLocale(DateFormatSymbols symbols, TimeZoneRuleFactory timeZoneRuleFactory, @Transient CharSequenceHashSet cache); String getAMPM(int index); String getEra(int index); String getMonth(int index); String getShortMonth(int index); TimeZoneRules getRules(CharSequence timeZoneName); String getShortWeekday(int index); String getWeekday(int index); TimeZoneRules getZoneRules(int index); long matchAMPM(CharSequence content, int lo, int hi); long matchEra(CharSequence content, int lo, int hi); long matchMonth(CharSequence content, int lo, int hi); long matchWeekday(CharSequence content, int lo, int hi); long matchZone(CharSequence content, int lo, int hi);  }### Answer:
@Test(expected = NumericException.class) public void testBadMonth() throws Exception { String date = "23 Dek 2010"; DateLocaleFactory.INSTANCE.getLocale("en-GB").matchMonth(date, 3, date.length()); }
@Test(expected = NumericException.class) public void testBadMonth2() throws Exception { String date = "23 Zek 2010"; DateLocaleFactory.INSTANCE.getLocale("en-GB").matchMonth(date, 3, date.length()); }
@Test public void testLongMonth() throws Exception { String date = "23 December 2010"; long result = DateLocaleFactory.INSTANCE.getLocale("en-GB").matchMonth(date, 3, date.length()); Assert.assertEquals(8, Numbers.decodeHighInt(result)); Assert.assertEquals(11, Numbers.decodeLowInt(result)); }
@Test public void testLowCaseLongMonth() throws Exception { String date = "23 december 2010"; long result = DateLocaleFactory.INSTANCE.getLocale("en-GB").matchMonth(date, 3, date.length()); Assert.assertEquals(8, Numbers.decodeHighInt(result)); Assert.assertEquals(11, Numbers.decodeLowInt(result)); }
@Test public void testRTLMonth() throws Exception { String s = "23مارس"; long result = DateLocaleFactory.INSTANCE.getLocale("ar-DZ").matchMonth(s, 2, s.length()); Assert.assertEquals(4, Numbers.decodeHighInt(result)); Assert.assertEquals(2, Numbers.decodeLowInt(result)); }
@Test public void testShortMonth() throws Exception { String date = "23 Sep 2010"; long result = DateLocaleFactory.INSTANCE.getLocale("en-GB").matchMonth(date, 3, date.length()); Assert.assertEquals(3, Numbers.decodeHighInt(result)); Assert.assertEquals(8, Numbers.decodeLowInt(result)); }
@Test(expected = NumericException.class) public void testWrongLength() throws Exception { String date = "23 Zek 2010"; DateLocaleFactory.INSTANCE.getLocale("en-GB").matchMonth(date, 30, date.length()); }