Primitive test using Java