code: @SuppressWarnings("unchecked")
      public <T extends IEntity> T findById(T entity) throws FMSException {
  
          IntuitMessage intuitMessage = prepareFindById(entity);
  
          //execute interceptors
          executeInterceptors(intuitMessage);
  
          T returnEntity = null;
          IntuitResponse intuitResponse = (IntuitResponse) intuitMessage.getResponseElements().getResponse();
          if (intuitResponse != null) {
              //QBD service is returning object as QueryResponse while QBO is returning object as IntuitObject in IntuitResponse
  
              if (intuitResponse.getIntuitObject() != null) {
                  JAXBElement<? extends IntuitEntity> intuitObject = intuitResponse.getIntuitObject();
                  if (intuitObject != null) {
                      returnEntity = ((T) intuitObject.getValue());
                  }
              } else if (intuitResponse.getQueryResponse() != null) {
                  QueryResponse queryResponse = intuitResponse.getQueryResponse();
                  List<JAXBElement<? extends IntuitEntity>> intuitObject = queryResponse.getIntuitObject();
                  if (intuitObject != null && intuitObject.size() > 0) {
                      returnEntity = ((T) intuitObject.get(0).getValue());
                  }
              }
          }
          return returnEntity;
      }
docs: Method to find the record for the given id for the corresponding entity
  
  @param entity
  @return returns the entity
  @throws FMSException