class LdapTemplate implements LdapOperations, InitializingBean {

    @Override
    public <T> T findOne(LdapQuery query, Class<T> clazz) {
        List<T> result = find(query, clazz);

        if (result.size() == 0) {
            throw new EmptyResultDataAccessException(1);
        }
        else if (result.size() != 1) {
            throw new IncorrectResultSizeDataAccessException(1, result.size());
        }

        return result.get(0);
    }

    public  LdapTemplate();
    public  LdapTemplate(ContextSource contextSource);

}