1、集合提取id转数组
Long[] ids = materialWarehousings.stream().map(MaterialWarehousing::getId).toArray(Long[]::new);
2、集合提取id转list<Long>
List<Long> idList = materialWarehousings.stream().map(MaterialWarehousing::getId).collect(Collectors.toList());
3、list<Long>转数组
Long[] ids = idList.stream().toArray(Long[]::new);
4、数组转List<Long>
List<Long> idList = Arrays.asList(ids);