Page<Object> page = (Page<Object>) result;
return entitiesToResources(page, assembler, baseLink);
} else if (result instanceof Iterable) {
return entitiesToResources((Iterable<Object>) result, assembler);
} else if (null == result) {
return new Resources(EMPTY_RESOURCE_LIST);
} else {
Resource<Object> resource = assembler.toFullResource(result);
return new Resources(Collections.singletonList(resource));
}
}