apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/InstanceService.java/InstanceService/findInstancesByNamespaceAndInstanceAppId
class InstanceService:  public Page<Instance> findInstancesByNamespaceAndInstanceAppId(String instanceAppId, String
      appId, String clusterName, String
                                                                     namespaceName, Pageable
                                                                     pageable) {
    Page<Object> instanceIdResult = instanceConfigRepository
        .findInstanceIdsByNamespaceAndInstanceAppId(instanceAppId, appId, clusterName,
            namespaceName, getValidInstanceConfigDate(), pageable);

    List<Instance> instances = Collections.emptyList();
    if (instanceIdResult.hasContent()) {
      Set<Long> instanceIds = instanceIdResult.getContent().stream().map((Object o) -> {
        if (o == null) {
          return null;
        }

        if (o instanceof Integer) {
          return ((Integer)o).longValue();
        }

        if (o instanceof Long) {
          return (Long) o;
        }

        //for h2 test
        if (o instanceof BigInteger) {
          return ((BigInteger) o).longValue();
        }

        return null;
      }).filter(Objects::nonNull).collect(Collectors.toSet());
      instances = findInstancesByIds(instanceIds);
    }

    return new PageImpl<>(instances, pageable, instanceIdResult.getTotalElements());
  }