BAEL-4236 | delete duplicate classes

This commit is contained in:
Vishal
2020-11-07 12:01:26 +05:30
parent dfb6a4eec2
commit 7bc828330b
4 changed files with 0 additions and 88 deletions

View File

@@ -1,24 +0,0 @@
package com.baeldung;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CopyListUsingAddAllMethodDemo {
static List<Integer> copyList(List<Integer> source) {
List<Integer> destination = new ArrayList<>();
destination.addAll(source);
return destination;
}
public static void main(String[] args) {
List<Integer> source = Arrays.asList(11, 22, 33);
List<Integer> destination = copyList(source);
System.out.println("copy = " + destination);
}
}

View File

@@ -1,21 +0,0 @@
package com.baeldung;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class CopyListUsingCollectionsCopyMethodDemo {
static void copyList(List<Integer> source, List<Integer> destination) {
Collections.copy(destination, source);
}
public static void main(String[] args) {
List<Integer> source = Arrays.asList(11, 22, 33);
List<Integer> destination = Arrays.asList(1, 2, 3, 4, 5);
copyList(source, destination);
System.out.println("copy = " + destination);
}
}

View File

@@ -1,21 +0,0 @@
package com.baeldung;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CopyListUsingConstructorDemo {
static List<Integer> copyList(List<Integer> source) {
return new ArrayList<>(source);
}
public static void main(String[] args) {
List<Integer> source = Arrays.asList(11, 22, 33);
List<Integer> destination = copyList(source);
System.out.println("copy = " + destination);
}
}

View File

@@ -1,22 +0,0 @@
package com.baeldung;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class CopyListUsingJava8StreamDemo {
static List<Integer> copyList(List<Integer> source) {
return source
.stream()
.collect(Collectors.toList());
}
public static void main(String[] args) {
List<Integer> source = Arrays.asList(11, 22, 33);
List<Integer> destination = copyList(source);
System.out.println("copy = " + destination);
}
}