Implementing compatibility with java lib