question: @ RequestMapping ( method = RequestMethod . POST ) ResponseEntity < Bookmark > addBookmark ( @ PathVariable ( value = "username" ) String username , @ RequestBody Bookmark bookmark ) throws UserNotFoundException { Optional < User > optional = usersRepository . findByUsername ( username ) ; if ( optional . isPresent ( ) ) { User user = optional . get ( ) ; user . addBookmark ( bookmark ) ; bookmark . setUser ( user ) ; bookmarksRepository . save ( bookmark ) ; return new ResponseEntity < > ( bookmark , HttpStatus . CREATED ) ; } else { throw new UserNotFoundException ( username ) ; } }
target:  A method to add a bookmark.