InAppRemoteConfig { @NonNull public static InAppRemoteConfig fromJsonMap(@Nullable JsonMap remoteConfig) { if (remoteConfig == null) { return InAppRemoteConfig.defaultConfig(); } TagGroupsConfig config = null; if (remoteConfig.containsKey(TAG_GROUPS_CONFIG_KEY)) { config = TagGroupsConfig.fromJsonValue(remoteConfig.opt(TAG_GROUPS_CONFIG_KEY)); } return (config != null) ? new InAppRemoteConfig(config) : InAppRemoteConfig.defaultConfig(); } private  InAppRemoteConfig(@NonNull TagGroupsConfig tagGroupsConfig); @NonNull static InAppRemoteConfig fromJsonMap(@Nullable JsonMap remoteConfig); @Override boolean equals(Object o); @Override int hashCode(); @NonNull
    final TagGroupsConfig tagGroupsConfig; }
@Test public void testFromJsonSingle() { JsonMap json = JsonMap.newBuilder() .put("tag_groups", JsonMap.newBuilder() .put("enabled", true) .put("cache_max_age_seconds", 1) .put("cache_stale_read_age_seconds", 2) .put("cache_prefer_local_until_seconds", 3) .build()) .build(); InAppRemoteConfig config = InAppRemoteConfig.fromJsonMap(json); assertNotNull(config); assertNotNull(config.tagGroupsConfig); assertTrue(config.tagGroupsConfig.isEnabled); assertEquals(1, config.tagGroupsConfig.cacheMaxAgeInSeconds); assertEquals(2, config.tagGroupsConfig.cacheStaleReadTimeSeconds); assertEquals(3, config.tagGroupsConfig.cachePreferLocalTagDataTimeSeconds); }