FstSerializer implements Serializer { public static FstSerializer create() { return new FstSerializer(); } private  FstSerializer(); @Override byte[] serialize(Serializable object); @Override Object deserialize(byte[] bytes); static FstSerializer create();  }
@Test public void guardString() { String stringData = "fooBar"; Guard<String> guardedString = new Guard.Builder<String>().serializer(FstSerializer.create()).build(); guardedString.set(stringData); assertEquals(stringData, guardedString.get()); }
@Test public void guardInt() { int intData = 127; Guard<Integer> guardedInt = new Guard.Builder<Integer>().serializer(FstSerializer.create()).build(); guardedInt.set(intData); Integer unBoxedInt = guardedInt.get(); assertNotNull(unBoxedInt); assertEquals(intData, (int) unBoxedInt); }
@Test public void create() throws Exception { assertNotNull(FstSerializer.create()); }