CategoryData { @Nullable public String totalSizeSaved() { return DisplayUtil.renderBytesSaved(Long.valueOf(bytesSaved)); } CategoryData(Category category);  CategoryData(Category category, int totalSuggestions);  CategoryData(Category category, int totalSuggestions, long bytesSaved); @Override String toString(); int totalSuggestions(); @Nullable String totalSizeSaved();  }
@Test public void checkSizeSavedNullWithZeroSavedBytes() { CategoryData categoryData = new CategoryData(Category.WEBP); assertThat(categoryData.totalSizeSaved()).isNull(); }
@Test public void checkSizeSavedWithNonZeroSavedBytes() { CategoryData categoryData = new CategoryData(Category.WEBP, 1, 1024); assertThat(categoryData.totalSizeSaved()).isEqualTo("1.00 KB"); }