class IntegrationIdFilter implements Function<ListResult<IntegrationDeployment>, ListResult<IntegrationDeployment>> {

    @Override
    public ListResult<IntegrationDeployment> apply(final ListResult<IntegrationDeployment> list) {
        if (integrationId == null) {
            return list;
        }

        final List<IntegrationDeployment> filtered = list.getItems().stream()
            .filter(i -> i.getSpec().idEquals(integrationId)).collect(Collectors.toList());

        return ListResult.of(filtered);
    }

      IntegrationIdFilter(final String integrationId);

}