@Test public void testFilterAndroidItems() { List<WhatsNewItemModel> whatsNewItems = new ArrayList<>(); WhatsNewItemModel item; item = new WhatsNewItemModel(); item.setPlatforms(Arrays.asList("android")); whatsNewItems.add(item); item = new WhatsNewItemModel(); item.setPlatforms(Arrays.asList("ios")); whatsNewItems.add(item); item = new WhatsNewItemModel(); item.setPlatforms(Arrays.asList("android", "ios")); whatsNewItems.add(item); assertThat(WhatsNewUtil.filterAndroidItems(whatsNewItems)).hasSize(2); }
@Nullable public static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems) { final List<WhatsNewItemModel> androidItems = new ArrayList<>(); for (WhatsNewItemModel item : whatsNewItems) { if (item.isAndroidMessage()) { androidItems.add(item); } } return androidItems.size() > 0 ? androidItems : null; }
WhatsNewUtil { @Nullable public static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems) { final List<WhatsNewItemModel> androidItems = new ArrayList<>(); for (WhatsNewItemModel item : whatsNewItems) { if (item.isAndroidMessage()) { androidItems.add(item); } } return androidItems.size() > 0 ? androidItems : null; } }
WhatsNewUtil { @Nullable public static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems) { final List<WhatsNewItemModel> androidItems = new ArrayList<>(); for (WhatsNewItemModel item : whatsNewItems) { if (item.isAndroidMessage()) { androidItems.add(item); } } return androidItems.size() > 0 ? androidItems : null; }  }
WhatsNewUtil { @Nullable public static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems) { final List<WhatsNewItemModel> androidItems = new ArrayList<>(); for (WhatsNewItemModel item : whatsNewItems) { if (item.isAndroidMessage()) { androidItems.add(item); } } return androidItems.size() > 0 ? androidItems : null; }  @Nullable static List<WhatsNewItemModel> getWhatsNewItems(@NonNull String buildVersion,
                                                           @NonNull List<WhatsNewModel> whatsNewModelsList); @Nullable static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems); }
WhatsNewUtil { @Nullable public static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems) { final List<WhatsNewItemModel> androidItems = new ArrayList<>(); for (WhatsNewItemModel item : whatsNewItems) { if (item.isAndroidMessage()) { androidItems.add(item); } } return androidItems.size() > 0 ? androidItems : null; }  @Nullable static List<WhatsNewItemModel> getWhatsNewItems(@NonNull String buildVersion,
                                                           @NonNull List<WhatsNewModel> whatsNewModelsList); @Nullable static List<WhatsNewItemModel> filterAndroidItems(@NonNull List<WhatsNewItemModel> whatsNewItems);  }