Fix assertion for java