### Question:
ResourceEditorAssociation { public boolean matches(Resource resource) { if (StringUtils.isNotBlank(parentType) && !hasParentType(resource)) { return false; } if (StringUtils.isNotBlank(resourceType) && !resourceType.equals(resource.getResourceType())) { return false; } return pathPattern.matcher(resource.getPath()).matches(); }  @Activate void activate(ResourceEditorAssociationConfig config); boolean matches(Resource resource); String getEditor(); @Override String toString();  }### Answer:
@Test public void testNonMatchingType() { Resource matching = Mockito.mock(Resource.class); Mockito.when(matching.getPath()).thenReturn("/content/sling-adobe-org"); Mockito.when(matching.getResourceType()).thenReturn(CMSConstants.NT_PAGE); assertFalse(rea.matches(matching)); }
@Test public void testNonMatchingPath() { Resource matching = Mockito.mock(Resource.class); Mockito.when(matching.getPath()).thenReturn("/conf/sling"); Mockito.when(matching.getResourceType()).thenReturn(CMSConstants.NT_SITE); assertFalse(rea.matches(matching)); }