@Test public void transformShouldReturnEmptyArrayIfNull() { ViewFormMapper mapper = new ViewFormMapper(); List<FormInfo> original = null; List<ViewForm> mapped = mapper.transform(original, mockSurveyGroup, "deleted"); assertNotNull(mapped); assertTrue(mapped.isEmpty()); }
@NonNull public List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup, String deletedString) { int capacity = forms == null ? 0 : forms.size(); List<ViewForm> viewForms = new ArrayList<>(capacity); if (forms == null) { return viewForms; } for (FormInfo formInfo : forms) { if (formInfo != null) { viewForms.add(transform(formInfo, mSurveyGroup, deletedString)); } } return viewForms; }
ViewFormMapper { @NonNull public List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup, String deletedString) { int capacity = forms == null ? 0 : forms.size(); List<ViewForm> viewForms = new ArrayList<>(capacity); if (forms == null) { return viewForms; } for (FormInfo formInfo : forms) { if (formInfo != null) { viewForms.add(transform(formInfo, mSurveyGroup, deletedString)); } } return viewForms; } }
ViewFormMapper { @NonNull public List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup, String deletedString) { int capacity = forms == null ? 0 : forms.size(); List<ViewForm> viewForms = new ArrayList<>(capacity); if (forms == null) { return viewForms; } for (FormInfo formInfo : forms) { if (formInfo != null) { viewForms.add(transform(formInfo, mSurveyGroup, deletedString)); } } return viewForms; }  }
ViewFormMapper { @NonNull public List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup, String deletedString) { int capacity = forms == null ? 0 : forms.size(); List<ViewForm> viewForms = new ArrayList<>(capacity); if (forms == null) { return viewForms; } for (FormInfo formInfo : forms) { if (formInfo != null) { viewForms.add(transform(formInfo, mSurveyGroup, deletedString)); } } return viewForms; }  @NonNull List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup,
            String deletedString); }
ViewFormMapper { @NonNull public List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup, String deletedString) { int capacity = forms == null ? 0 : forms.size(); List<ViewForm> viewForms = new ArrayList<>(capacity); if (forms == null) { return viewForms; } for (FormInfo formInfo : forms) { if (formInfo != null) { viewForms.add(transform(formInfo, mSurveyGroup, deletedString)); } } return viewForms; }  @NonNull List<ViewForm> transform(@Nullable List<FormInfo> forms, SurveyGroup mSurveyGroup,
            String deletedString);  }