### Question:
Languages { public static boolean includes(final Language language1, final Language language2) { if(language1==null || language2==null) { return false; } if(language1.isWildcard()) { return true; } if(language2.isWildcard()) { return false; } return language1.primaryTag().equals(language2.primaryTag()) && (language1.subTag().isEmpty() || language1.subTag().equals(language2.subTag())); } private  Languages(); static Language wildcard(); static Language of(final Locale locale); static Language fromString(final String language); static boolean includes(final Language language1, final Language language2);  }### Answer:
@Test public void nullDoesNotIncludeAnything(@Mocked final Language language) throws Exception { assertThat(Languages.includes(null,language),equalTo(false)); }
@Test public void nothingIncludesNull(@Mocked final Language language) throws Exception { assertThat(Languages.includes(language,null),equalTo(false)); }
@Test public void wildcardLanguageIncludesEverything(@Mocked final Language language) throws Exception { assertThat(Languages.includes(WILDCARD,language),equalTo(true)); }
@Test public void wildcardLanguageIsNotIncludedBySpecificLanguages(@Mocked final Language language) throws Exception { new Expectations() {{ language.isWildcard();result=false; }}; assertThat(Languages.includes(language,WILDCARD),equalTo(false)); }
@Test public void aLanguageWithJustPrimaryTagIncludesItself() throws Exception { assertThat(Languages.includes(ENGLISH,ENGLISH),equalTo(true)); }
@Test public void aLanguageWithJustPrimaryTagIncludesLanguagesWithTheSamePrimaryTagAndAnyOtherSubTag() throws Exception { assertThat(Languages.includes(ENGLISH,US_ENGLISH),equalTo(true)); }
@Test public void aLanguageWithSubTagDoesNotIncludeLanguagesWithSamePrimaryTagButDifferentSubtag() throws Exception { assertThat(Languages.includes(US_ENGLISH,ENGLISH),equalTo(false)); }
@Test public void aLanguageWithPrimaryTagAndSubtagIncludesItself() throws Exception { assertThat(Languages.includes(US_ENGLISH, US_ENGLISH),equalTo(true)); }