### Question:
BasicObjectPermissionArgumentVoter implements AccessDecisionVoter<Object>, AfterInvocationProvider { @Override public boolean supports(Class clazz) { return MethodInvocation.class.isAssignableFrom(clazz) || ObjectPermission.class.isAssignableFrom(clazz) || Collection.class.isAssignableFrom(clazz); }  @Override boolean supports(Class clazz); @Override int vote(Authentication authentication, Object object, Collection<ConfigAttribute> attributes); @Override Object decide(Authentication authentication, Object object, Collection<ConfigAttribute> attributes,
            Object returnedObject);  }### Answer:
@Test public void supports_class(){ when(voter.supports(any(Class.class))).thenCallRealMethod(); assertTrue(voter.supports(MethodInvocation.class)); assertTrue(voter.supports(ObjectPermission.class)); assertTrue(voter.supports(Collection.class)); assertFalse(voter.supports(String.class)); }
@Test @Ignore public void supports_class_config_argumentTypeCheck(){ when(voter.supports(String.class)).thenReturn(true); when(voter.supports(Integer.class)).thenReturn(false); when(voter.supports(any(ConfigAttribute.class))).thenReturn(true); when(voter.supports(any(Class.class), any(Collection.class))).thenCallRealMethod(); List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>(1); attributes.add(new ConfigAttributeMock("test")); assertTrue(voter.supports("testString", attributes)); assertFalse(voter.supports(Integer.valueOf(1), attributes)); }
@Test @Ignore public void supports_class_config_attributesCheck(){ when(voter.supports(any(Class.class))).thenReturn(true); when(voter.supports(any(ConfigAttribute.class))).thenReturn(true); when(voter.supports(any(Class.class), any(Collection.class))).thenCallRealMethod(); List<ConfigAttribute> attributes = new ArrayList<ConfigAttribute>(1); attributes.add(new ConfigAttributeMock("testAttribute")); assertTrue(voter.supports("testString", attributes)); when(voter.supports(any(ConfigAttribute.class))).thenReturn(false); assertFalse(voter.supports("testString", attributes)); }