The Java API should have this as an interface as it uses these two methods too often... Do they change sometimes or are they always like this? Maybe we should file an issue/PR against the Java API then.