UnstakePayloadConverter implements PayloadConverter<Unstake> { @Override public BytesValue convertToPayload(final Unstake 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 Unstake stake); @Override Unstake parseToModel(final BytesValue payload);  }
@Test public void testConvertToPayload() { final PayloadConverter<Unstake> converter = new UnstakePayloadConverter(); final Unstake unStake = Unstake.newBuilder().build(); final BytesValue payload = converter.convertToPayload(unStake); assertNotNull(payload); }