Is there an Intellij IDEA refactoring that can replace a lambda expression with a function and function reference?
I have:
List<String> convertToASlashBList(Collection<MyBean> beans) {
return beans.stream().map(bean -> "" + bean.getA() + "/" + bean.getB()).collect(toList());
}
I want:
List<String> convertToASlashBList(Collection<MyBean> beans) {
return beans.stream().map(this::convertToASlashB).collect(toList());
}
private String convertToASlashB(MyBean bean) {
return "" + bean.getA() + "/" + bean.getB();
}
There is the refactoring to extract an anonymous class but that is actually something different.