How do I develop only one shared testNG test for Android and IOS apps with the same UI?

I have an iOS app and an Android app. Both have the the same UI. I can develop page object by stacking Android and iOS findbys to avoid duplicate code. How can write one shared TestNG test for Android and iOS to avoid duplicate code ? Does anyone have code example you can share?