Test q impl in java