### Question:
AnnotationChecker { public List<Method> getAutoWireMethods() { List<Method> methodList = new ArrayList<Method>(); Method[] methods = instance.getDeclaredMethods(); for (Method method : methods) { if (isNotNull(method.getAnnotation(MyAutoWire.class))) { methodList.add(method); } } return methodList; } AnnotationChecker(Class<?> instance); boolean isMyComponent(); List<Method> getAutoWireMethods(); List<Field> getAutoWireFields();  }### Answer:
@Test public void testGetAutoWireMethodsWithAnnotationPresent() { final AnnotationChecker instance = new AnnotationChecker( ClassWithAttributes.class); List<Method> methods = instance.getAutoWireMethods(); assertEquals(1, methods.size()); Method method = methods.get(0); String name = method.getName(); assertEquals("setValue1", name); MyAutoWire myComponent = method.getAnnotation(MyAutoWire.class); assertNotNull(myComponent); }
@Test public void testGetAutoWireMethodsWithNoMethodsAnnotated() { final AnnotationChecker instance = new AnnotationChecker(String.class); List<Method> methods = instance.getAutoWireMethods(); assertEquals(0, methods.size()); }