public Capacity getCapacity(String group, String tenant) {
        if (tenant != null) {
            return getTenantCapacity(tenant);
        }
        return getGroupCapacity(group);
    }
@Test
    void testGetCapacity() {
        GroupCapacity groupCapacity = new GroupCapacity();
        groupCapacity.setId(1L);
        when(groupCapacityPersistService.getGroupCapacity(eq("testGroup"))).thenReturn(groupCapacity);
        
        TenantCapacity tenantCapacity = new TenantCapacity();
        tenantCapacity.setId(2L);
        when(tenantCapacityPersistService.getTenantCapacity(eq("testTenant"))).thenReturn(tenantCapacity);
        
        Capacity resCapacity1 = service.getCapacity("testGroup", null);
        assertEquals(1L, resCapacity1.getId().longValue());
        
        Capacity resCapacity2 = service.getCapacity(null, "testTenant");
        assertEquals(2L, resCapacity2.getId().longValue());
    }