ParaList implements Serializable { public ParaList(List<StoreParas> lists) { if ( lists == null ) throw new RuntimeException("lists can not be null"); this.lists = lists; this.size = lists.size(); } ParaList(List<StoreParas> lists); int getSize(); List<StoreParas> getLists(); void setLists(List<StoreParas> lists); byte[] toBytes(); static ParaList toParaList(byte[] bytes);  }
@Test(groups = { "test"}) public void TestParaList() { int size = 3; List<StoreParas> list = new ArrayList<StoreParas>(size); for ( int i = 0 ; i < size ; i++) { list.add( new StoreParas(OpType.Put, Key.createKey("test-"+i), new BlockValue(("test-"+i).getBytes() ,i, (short ) 0)) ); } byte[] bytes = new ParaList( list).toBytes(); ParaList paraList = ParaList.toParaList( bytes); assertEquals(paraList.getSize(), list.size()); int i = 0; for ( StoreParas each : paraList.getLists()){ assertEquals( each.getOpType(), list.get(i).getOpType() ); assertEquals( (byte[]) each.getValue().getData(), (byte[]) list.get(i++).getValue().getData()); } }