### Question:
BaseSubsystem extends AnnotatedSubsystem<M> { @Request(Capability.CMD_SET_ATTRIBUTES) public MessageBody setAttributes(PlatformMessage message, SubsystemContext<M> context) { MessageBody request = message.getValue(); List<Map<String, Object>> errors = new ArrayList<> (); for(Map.Entry<String, Object> entry: request.getAttributes().entrySet()) { try { setAttribute(entry.getKey(), entry.getValue(), context); } catch(ErrorEventException e) { context.logger().warn("Error setting attribute [{}]", entry.getKey(), e); errors.add(e.toErrorEvent().getAttributes()); } catch(Exception e) { context.logger().warn("Error setting attribute [{}]", entry.getKey(), e); errors.add(Errors.invalidParam(entry.getKey()).getAttributes()); } } if(errors.isEmpty()) { return MessageBody.emptyMessage(); } else { return MessageBody.buildMessage(Capability.EVENT_SET_ATTRIBUTES_ERROR, ImmutableMap.<String, Object>of("errors", errors)); } }  @Inject void setDefinitionRegistry(DefinitionRegistry registry); @Request(Capability.CMD_GET_ATTRIBUTES) MessageBody getAttributes(
         @Named("names") Set<String> names,
         SubsystemContext<M> context
   ); @Request(Capability.CMD_SET_ATTRIBUTES) MessageBody setAttributes(PlatformMessage message, SubsystemContext<M> context); @Request(AddTagsRequest.NAME) void addTags(
         @Named(AddTagsRequest.ATTR_TAGS) Set<String> tags,
         SubsystemContext<M> context
   ); @Request(RemoveTagsRequest.NAME) void removeTags(
         @Named(RemoveTagsRequest.ATTR_TAGS) Set<String> tags,
         SubsystemContext<M> context
   );  }### Answer:
@Test public void testSetAttributes() { Map<String, String> images = ImmutableMap.of("test", "image"); MessageReceivedEvent event = request( Capability.CMD_SET_ATTRIBUTES, ImmutableMap.<String, Object>of(Capability.ATTR_IMAGES, images) ); subsystem.onEvent(event, context); assertEquals(1, responses.getValues().size()); { MessageBody response = responses.getValue(); assertEquals(MessageConstants.MSG_EMPTY_MESSAGE, response.getMessageType()); assertEquals(ImmutableMap.of(), response.getAttributes()); } { assertEquals(images, model.getAttribute(Capability.ATTR_IMAGES)); } }