StakePayloadConverter implements PayloadConverter<Stake> { @Override public BytesValue convertToPayload(final Stake stake) { logger.debug("Convert to payload from {}", stake); final Map<String, Object> map = new HashMap<>(); map.put("Name", stake.getOperationName()); map.put("Args", Collections.emptyList()); return mapper.marshal(map); }  @Override BytesValue convertToPayload(final Stake stake); @Override Stake parseToModel(final BytesValue payload);  }
@Test public void testConvertToPayload() { final PayloadConverter<Stake> converter = new StakePayloadConverter(); final Stake stake = Stake.newBuilder().build(); final BytesValue payload = converter.convertToPayload(stake); assertNotNull(payload); }