void setTypeSpaces(EnumCounters<StorageType> that) {
    if (that == STORAGE_TYPE_DEFAULT || that == STORAGE_TYPE_RESET) {
      tsCounts = that;
    } else if (that != null) {
      tsCounts = modify(tsCounts, ec -> ec.set(that));
    }
  }
@Test
  public void testSetTypeSpaces() throws Exception {
    QuotaCounts qc1 = new QuotaCounts.Builder().build();
    QuotaCounts qc2 = new QuotaCounts.Builder().nameSpace(1).storageSpace(512)
        .typeSpaces(5).build();
    qc1.setTypeSpaces(qc2.getTypeSpaces());
    for (StorageType t : StorageType.values()) {
      assertEquals(qc2.getTypeSpace(t), qc1.getTypeSpace(t));
    }

    // test ConstEnumCounters
    qc1.setTypeSpaces(QuotaCounts.STORAGE_TYPE_RESET);
    assertSame(QuotaCounts.STORAGE_TYPE_RESET, qc1.tsCounts);
  }