return Optional.ofNullable(brokerRepository.findOne(id))
.map(broker -> new ResponseEntity<>(
broker,
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));

  

05-11 17:29