LPS-41012 move code to Java class (no changes)