code: public void registerDetails(final AbstractGrid<?>.DetailsSupport details) {
          grid.addSelectionListener(event -> {
              final Long masterId = (Long) event.getSelected().stream().findFirst().orElse(null);
              details.populateMasterDataAndRecalculateContainer(masterId);
          });
      }
docs: Registers the selection of this grid as master for another grid that
  displays the details.
  
  @param details
  the details of another grid the selection of this grid should
  be registered for as master.