MasterRole extends AbstractRole { @Override public ByteBuf format() { Object[] tmp = new Object[] { serverRole.toString(), offset, new Object[0]}; return new ArrayParser(tmp).format(); } MasterRole(Object []payload);  MasterRole(); @Override ByteBuf format(); @Override String toString();  }
@Test public void testFormat(){ ByteBuf format = new MasterRole().format(); String formatStr = ByteBufUtils.readToString(format); Assert.assertEquals("*3\r\n+master\r\n:0\r\n*0\r\n", formatStr); logger.info("{}", formatStr); }