Code example for Random

0
 * @since 19.01.12 
 */ 
@Test 
public class CharSerializerTest { 
  private static final int       FIELD_SIZE = 2;
  private static final Character OBJECT     = (char) (new Random()).nextInt();
  private OCharSerializer        charSerializer;
  byte[]                         stream     = new byte[FIELD_SIZE];
 
  @BeforeClass 
  public void beforeClass() { 
    charSerializer = new OCharSerializer();
  } 
 
  public void testFieldSize() { 
    Assert.assertEquals(charSerializer.getObjectSize(null), FIELD_SIZE);
  } 
 
  public void testSerialize() { 
    charSerializer.serialize(OBJECT, stream, 0);