Merge remote-tracking branch 'upstream/master'
diff --git a/boolean_test.go b/boolean_test.go
index 499cfcf..0855cd3 100644
--- a/boolean_test.go
+++ b/boolean_test.go
@@ -45,3 +45,8 @@
 	testDecodeFramework(t, "replyFalse", false)
 	testDecodeFramework(t, "replyTrue", true)
 }
+
+func TestBooleanEncode(t *testing.T) {
+	testJavaDecode(t, "argFalse", false)
+	testJavaDecode(t, "argTrue", true)
+}
diff --git a/double_test.go b/double_test.go
index c448cae..81d309e 100644
--- a/double_test.go
+++ b/double_test.go
@@ -54,3 +54,19 @@
 	testDecodeFramework(t, "replyDouble_m129_0", -129.0)
 	testDecodeFramework(t, "replyDouble_m32768_0", -32768.0)
 }
+
+func TestDoubleEncode(t *testing.T) {
+	testJavaDecode(t, "argDouble_0_0", 0.0)
+	testJavaDecode(t, "argDouble_0_001", 0.001)
+	testJavaDecode(t, "argDouble_1_0", 1.0)
+	testJavaDecode(t, "argDouble_127_0", 127.0)
+	testJavaDecode(t, "argDouble_128_0", 128.0)
+	testJavaDecode(t, "argDouble_2_0", 2.0)
+	testJavaDecode(t, "argDouble_3_14159", 3.14159)
+	testJavaDecode(t, "argDouble_32767_0", 32767.0)
+	testJavaDecode(t, "argDouble_65_536", 65.536)
+	testJavaDecode(t, "argDouble_m0_001", -0.001)
+	testJavaDecode(t, "argDouble_m128_0", -128.0)
+	testJavaDecode(t, "argDouble_m129_0", -129.0)
+	testJavaDecode(t, "argDouble_m32768_0", -32768.0)
+}
diff --git a/int_test.go b/int_test.go
index 536bbcd..a0acc44 100644
--- a/int_test.go
+++ b/int_test.go
@@ -99,3 +99,22 @@
 	testDecodeFramework(t, "replyInt_m16", int32(-16))
 	testDecodeFramework(t, "replyInt_m17", int32(-17))
 }
+
+func TestIntEncode(t *testing.T) {
+	testJavaDecode(t, "argInt_0", int32(0))
+	testJavaDecode(t, "argInt_0x30", int32(0x30))
+	testJavaDecode(t, "argInt_0x3ffff", int32(0x3ffff))
+	testJavaDecode(t, "argInt_0x40000", int32(0x40000))
+	testJavaDecode(t, "argInt_0x7ff", int32(0x7ff))
+	testJavaDecode(t, "argInt_0x7fffffff", int32(0x7fffffff))
+	testJavaDecode(t, "argInt_0x800", int32(0x800))
+	testJavaDecode(t, "argInt_1", int32(1))
+	testJavaDecode(t, "argInt_47", int32(47))
+	testJavaDecode(t, "argInt_m0x40000", int32(-0x40000))
+	testJavaDecode(t, "argInt_m0x40001", int32(-0x40001))
+	testJavaDecode(t, "argInt_m0x800", int32(-0x800))
+	testJavaDecode(t, "argInt_m0x80000000", int32(-0x80000000))
+	testJavaDecode(t, "argInt_m0x801", int32(-0x801))
+	testJavaDecode(t, "argInt_m16", int32(-16))
+	testJavaDecode(t, "argInt_m17", int32(-17))
+}
diff --git a/long_test.go b/long_test.go
index 8b2518b..76c9dec 100644
--- a/long_test.go
+++ b/long_test.go
@@ -142,3 +142,23 @@
 	testDecodeFramework(t, "replyLong_m8", int64(-8))
 	testDecodeFramework(t, "replyLong_m9", int64(-9))
 }
+
+func TestLongEncode(t *testing.T) {
+	testJavaDecode(t, "argLong_0", int64(0))
+	testJavaDecode(t, "argLong_0x10", int64(0x10))
+	testJavaDecode(t, "argLong_0x3ffff", int64(0x3ffff))
+	testJavaDecode(t, "argLong_0x40000", int64(0x40000))
+	testJavaDecode(t, "argLong_0x7ff", int64(0x7ff))
+	testJavaDecode(t, "argLong_0x7fffffff", int64(0x7fffffff))
+	testJavaDecode(t, "argLong_0x800", int64(0x800))
+	testJavaDecode(t, "argLong_1", int64(1))
+	testJavaDecode(t, "argLong_15", int64(15))
+	testJavaDecode(t, "argLong_m0x40000", int64(-0x40000))
+	testJavaDecode(t, "argLong_m0x40001", int64(-0x40001))
+	testJavaDecode(t, "argLong_m0x800", int64(-0x800))
+	testJavaDecode(t, "argLong_m0x80000000", int64(-0x80000000))
+	testJavaDecode(t, "argLong_m0x80000001", int64(-0x80000001))
+	testJavaDecode(t, "argLong_m0x801", int64(-0x801))
+	testJavaDecode(t, "argLong_m8", int64(-8))
+	testJavaDecode(t, "argLong_m9", int64(-9))
+}