### Question:
CategoryProvider implements InitializingBean { public static boolean checkCategoryMatchingMainCategory(int cat, int possibleMainCat) { return possibleMainCat % 1000 == 0 && cat / 1000 == possibleMainCat / 1000; } CategoryProvider(); @Override void afterPropertiesSet(); @org.springframework.context.event.EventListener void handleNewConfigEvent(ConfigChangedEvent newConfig); List<Category> getCategories(); void setCategories(List<Category> categories); Category getByInternalName(String name); Category getNotAvailable(); Category fromSearchNewznabCategories(String cats); Optional<Category> fromSubtype(Subtype subtype); Category fromSearchNewznabCategories(List<Integer> cats, Category defaultCategory); Category fromResultNewznabCategories(List<Integer> cats); static boolean checkCategoryMatchingMainCategory(int cat, int possibleMainCat); Category getMatchingCategoryOrMatchingMainCategory(List<Integer> cats, Category defaultCategory); static final Category naCategory; }### Answer:
@Test public void testcheckCategoryMatchingMainCategory() { assertThat(testee.checkCategoryMatchingMainCategory(5030, 5000), is(true)); assertThat(testee.checkCategoryMatchingMainCategory(5000, 5000), is(true)); assertThat(testee.checkCategoryMatchingMainCategory(4030, 5000), is(false)); assertThat(testee.checkCategoryMatchingMainCategory(4000, 5000), is(false)); assertThat(testee.checkCategoryMatchingMainCategory(4030, 4030), is(false)); }