### Question:
TynamoDecorator implements DescriptorDecorator { void decorateFromAnnotations(Descriptor descriptor, Annotation[] annotations) { for (Annotation annotation : annotations) { HandledBy handledBy = annotation.annotationType().getAnnotation(HandledBy.class); if (handledBy != null) { try { String serviceId = handledBy.value(); DescriptorAnnotationHandler handler = locator.getService(serviceId, DescriptorAnnotationHandler.class); handler.decorateFromAnnotation(annotation, descriptor); } catch (Exception ex) { LOGGER.error("error decorating: " + descriptor.toString() + " with " + annotation.toString(), ExceptionUtils.getRootCauseMessage(ex)); } } } } TynamoDecorator(ObjectLocator locator); TynamoClassDescriptor decorate(TynamoClassDescriptor descriptor);  }### Answer:
@Test void decorateFromAnnotations() { TynamoClassDescriptorImpl descriptor = new TynamoClassDescriptorImpl(AnnotatedClass.class); HandledAnnotation annotation = AnnotatedClass.class.getAnnotation(HandledAnnotation.class); ObjectLocator locator = newMock(ObjectLocator.class); DescriptorAnnotationHandler annotationHandler = newMock(DescriptorAnnotationHandler.class); annotationHandler.decorateFromAnnotation(annotation, descriptor); EasyMock.expectLastCall().once(); expect(locator.getService("AnnotationHandler", DescriptorAnnotationHandler.class)).andReturn(annotationHandler); replay(); TynamoDecorator decorator = new TynamoDecorator(locator); decorator.decorateFromAnnotations(descriptor, AnnotatedClass.class.getAnnotations()); verify(); }