### Question:
RequestMetadataWrapper { public Map<String, Object> getMetadataAttributes() { return Collections.list(request.getAttributeNames()) .stream() .filter(this::isMetadataAttribute) .collect(Collectors.toMap(name -> name, request::getAttribute)); } RequestMetadataWrapper(final HttpServletRequest request); Map<String, Object> getMetadataAttributes();  }### Answer:
@Test void shouldReturnOnlyNixerAttributes() { request.setAttribute("spring.attribute", "something"); request.setAttribute(RequestMetadata.GLOBAL_CREDENTIAL_STUFFING, true); final RequestMetadataWrapper wrapper = new RequestMetadataWrapper(request); assertThat(wrapper.getMetadataAttributes()) .containsEntry(RequestMetadata.GLOBAL_CREDENTIAL_STUFFING, true) .hasSize(1); }
@Test void shouldReturnEmptyCollectionIfAttributesMissing() { final RequestMetadataWrapper wrapper = new RequestMetadataWrapper(request); assertThat(wrapper.getMetadataAttributes()).isEmpty(); }