class InstrumentAccountCodeContractRepository {

    public InstrumentAccountCodeContract findById(InstrumentAccountCodeContract instrumentAccountCodeContract) {

        String url = String.format("%s%s", hostUrl, SEARCH_URL);
        StringBuffer content = new StringBuffer();
        if (instrumentAccountCodeContract.getId() != null)
            content.append("id=" + instrumentAccountCodeContract.getId());

        if (instrumentAccountCodeContract.getTenantId() != null)
            content.append("&tenantId=" + instrumentAccountCodeContract.getTenantId());
        url = url + content.toString();
        InstrumentAccountCodeResponse result = restTemplate.postForObject(url, null,
                InstrumentAccountCodeResponse.class);

        if (result.getInstrumentAccountCodes() != null && result.getInstrumentAccountCodes().size() == 1)
            return result.getInstrumentAccountCodes().get(0);
        else
            return null;

    }

    public  InstrumentAccountCodeContractRepository(@Value("${egf.instrument.host.url}") String hostUrl,
            RestTemplate restTemplate);

}