static String clientQuotaEntityToString(ClientQuotaEntity entity) {
        if (entity.entries().isEmpty()) {
            throw new RuntimeException("Invalid empty entity");
        }
        String clientId = null;
        String ip = null;
        String user = null;
        for (Map.Entry<String, String> entry : entity.entries().entrySet()) {
            if (entry.getKey().equals(CLIENT_ID)) {
                clientId = entry.getValue();
            } else if (entry.getKey().equals(IP)) {
                ip = entry.getValue();
            } else if (entry.getKey().equals(USER)) {
                user = entry.getValue();
            } else {
                throw new RuntimeException("Invalid entity type " + entry.getKey());
            }
        }
        StringBuilder bld = new StringBuilder();
        String prefix = "";
        if (clientId != null) {
            bld.append(prefix).append("clientId(").append(escape(clientId)).append(")");
            prefix = "_";
        }
        if (ip != null) {
            bld.append(prefix).append("ip(").append(escape(ip)).append(")");
            prefix = "_";
        }
        if (user != null) {
            bld.append(prefix).append("user(").append(escape(user)).append(")");
            prefix = "_";
        }
        return bld.toString();
    }
@Test
    public void testErrorOnInvalidEmptyEntityName() {
        assertEquals("Invalid empty entity",
            assertThrows(RuntimeException.class, () -> ClientQuotasImageNode.
                clientQuotaEntityToString(new ClientQuotaEntity(emptyMap()))).
                    getMessage());
    }