ResubscribeHelper { static void initializeAutoTaggingAndResubscription(Object target, ObservableGroup group) { Class<?> cls = target.getClass(); String clsName = cls.getName(); while (cls != null && !clsName.startsWith("android.") && !clsName.startsWith("java.")) { initializeAutoTaggingAndResubscriptionInTargetClassOnly(target, cls, group); cls = cls.getSuperclass(); if (cls != null) { clsName = cls.getName(); } } }    }
@Test public void leafClassInitDoesIntializeEntireHierarchy() { LeafClass leafClass = new LeafClass(); ResubscribeHelper.initializeAutoTaggingAndResubscription(leafClass, new ObservableGroup(1)); assertThat(leafClass.baseInitialized).isTrue(); assertThat(leafClass.middleInitialized).isTrue(); assertThat(leafClass.leafInitialized).isTrue(); }