ActiveCollectionUtil { public static byte[] serializeACS(java.util.List<ActiveCollectionSource> acs) throws Exception { byte[] ret=null; java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); MAPPER.writeValue(baos, acs); ret = baos.toByteArray(); baos.close(); return (ret); } private  ActiveCollectionUtil(); static byte[] serializeACS(java.util.List<ActiveCollectionSource> acs); @SuppressWarnings("unchecked") static java.util.List<ActiveCollectionSource> deserializeACS(byte[] acs); static byte[] serializeQuerySpec(QuerySpec qs); static QuerySpec deserializeQuerySpec(byte[] qs);  }
@Test public void testSerializeACS() { ActiveCollectionSource acs=new ActiveCollectionSource(); acs.setName("TestACS"); acs.getProperties().put("testProp", "testValue"); java.util.List<ActiveCollectionSource> list=new java.util.Vector<ActiveCollectionSource>(); list.add(acs); try { byte[] b=ActiveCollectionUtil.serializeACS(list); System.out.println("Serialized ACS="+new String(b)); } catch(Exception e) { fail("Failed to serialize: "+e); } }