code: private <T> T getOne(List<T> list) {
          if (list.size() == 1) {
              return list.get(0);
          } else if (list.size() > 1) {
              throw new TooManyResultsException("Expected one result (or null) to be returned by selectOne()," +
                      " but found: " + list
                      .size());
          } else {
              return null;
          }
      }
docs: 获取List中最多只有一个的数据
  
  @param list List结果
  @param <T>  泛型类型
  @return result