QuotaUsage { @Override public String toString() { return toString(false); } protected  QuotaUsage(); protected  QuotaUsage(Builder builder); long getFileAndDirectoryCount(); long getQuota(); long getSpaceConsumed(); long getSpaceQuota(); long getTypeQuota(StorageType type); long getTypeConsumed(StorageType type); boolean isTypeQuotaSet(); boolean isTypeConsumedAvailable(); @Override boolean equals(Object to); @Override int hashCode(); static String getHeader(); @Override String toString(); String toString(boolean hOption); String toString(boolean hOption,
      boolean tOption, List<StorageType> types); static String getStorageTypeHeader(List<StorageType> storageTypes);  }
@Test public void testToStringWithQuota() { long fileAndDirCount = 55555; long quota = 44444; long spaceConsumed = 55555; long spaceQuota = 66665; QuotaUsage quotaUsage = new QuotaUsage.Builder(). fileAndDirectoryCount(fileAndDirCount).quota(quota). spaceConsumed(spaceConsumed).spaceQuota(spaceQuota).build(); String expected =" 44444 -11111 66665" + " 11110 "; assertEquals(expected, quotaUsage.toString()); }
@Test public void testToStringNoQuota() { QuotaUsage quotaUsage = new QuotaUsage.Builder(). fileAndDirectoryCount(1234).build(); String expected = " none inf none" + " inf "; assertEquals(expected, quotaUsage.toString()); }
@Test public void testToStringHumanWithQuota() { long fileAndDirCount = 222255555; long quota = 222256578; long spaceConsumed = 1073741825; long spaceQuota = 1; QuotaUsage quotaUsage = new QuotaUsage.Builder(). fileAndDirectoryCount(fileAndDirCount).quota(quota). spaceConsumed(spaceConsumed).spaceQuota(spaceQuota).build(); String expected = " 212.0 M 1023 1 " + " -1 G "; assertEquals(expected, quotaUsage.toString(true)); }