public List<Integer> doubling(List<Integer> nums) {
List<Integer> answer = new ArrayList<>();
answer = nums.stream()
.map(n -> n*2)
.collect(Collectors.toList());
return answer;
}
public List<Integer> doubling(List<Integer> nums) {
nums.replaceAll(n -> n * 2);
return nums;
}
public List<Integer> square(List<Integer> nums) {
nums.replaceAll(n -> n * n);
return nums;
}
public List<String> addStar(List<String> strings) {
strings = strings.stream()
.map(n -> n+"*")
.collect(Collectors.toList());
return strings;
}
public List<String> copies3(List<String> strings) {
strings = strings.stream()
.map(n -> n + n + n)
.collect(Collectors.toList());
return strings;
}
public List<String> moreY(List<String> strings) {
strings = strings.stream()
.map(n -> "y"+n+"y")
.collect(Collectors.toList());
return strings;
}
public List<Integer> math1(List<Integer> nums) {
nums = nums.stream()
.map(n -> (n+1)*10)
.collect(Collectors.toList());
return nums;
}
public List<Integer> rightDigit(List<Integer> nums) {
nums = nums.stream()
.map(n -> n%10)
.collect(Collectors.toList());
return nums;
}
public List<String> lower(List<String> strings) {
return strings.stream()
.map(s -> s.toLowerCase())
.collect(Collectors.toList());
}
public List<String> noX(List<String> strings) {
return strings.stream()
.map(s -> s.replaceAll("x",""))
.collect(Collectors.toList());
}