Skip to content

Commit 0579815

Browse files
authored
Merge pull request eugenp#6982 from amit2103/BAEL-12898
[BAEL-12898] - Splitted the core-java-collections-list module
2 parents 8bbd941 + 9c25ef8 commit 0579815

File tree

31 files changed

+208
-48
lines changed

31 files changed

+208
-48
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=========
2+
3+
## Core Java Collections Array List Cookbooks and Examples
4+
5+
### Relevant Articles:
6+
- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list)
7+
- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist)
8+
- [Add Multiple Items to an Java ArrayList](http://www.baeldung.com/java-add-items-array-list)
9+
- [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist)
10+
- [Multi Dimensional ArrayList in Java](https://www.baeldung.com/java-multi-dimensional-arraylist)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>core-java-collections-array-list</artifactId>
5+
<version>0.1.0-SNAPSHOT</version>
6+
<name>core-java-collections-array-list</name>
7+
<packaging>jar</packaging>
8+
9+
<parent>
10+
<groupId>com.baeldung</groupId>
11+
<artifactId>parent-java</artifactId>
12+
<version>0.0.1-SNAPSHOT</version>
13+
<relativePath>../../parent-java</relativePath>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.apache.commons</groupId>
19+
<artifactId>commons-collections4</artifactId>
20+
<version>${commons-collections4.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>org.apache.commons</groupId>
24+
<artifactId>commons-lang3</artifactId>
25+
<version>${commons-lang3.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.assertj</groupId>
29+
<artifactId>assertj-core</artifactId>
30+
<version>${assertj.version}</version>
31+
<scope>test</scope>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.projectlombok</groupId>
35+
<artifactId>lombok</artifactId>
36+
<version>${lombok.version}</version>
37+
<scope>provided</scope>
38+
</dependency>
39+
</dependencies>
40+
41+
<properties>
42+
<commons-collections4.version>4.1</commons-collections4.version>
43+
<commons-lang3.version>3.8.1</commons-lang3.version>
44+
<assertj.version>3.11.1</assertj.version>
45+
</properties>
46+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.baeldung.java.list;
2+
3+
public class Flower {
4+
5+
private String name;
6+
private int petals;
7+
8+
public Flower(String name, int petals) {
9+
this.name = name;
10+
this.petals = petals;
11+
}
12+
13+
public String getName() {
14+
return name;
15+
}
16+
17+
public void setName(String name) {
18+
this.name = name;
19+
}
20+
21+
public int getPetals() {
22+
return petals;
23+
}
24+
25+
public void setPetals(int petals) {
26+
this.petals = petals;
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<encoder>
5+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6+
</pattern>
7+
</encoder>
8+
</appender>
9+
10+
<root level="INFO">
11+
<appender-ref ref="STDOUT" />
12+
</root>
13+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=========
2+
3+
## Core Java Collections List Cookbooks and Examples
4+
5+
### Relevant Articles:
6+
- [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality)
7+
- [Java 8 Streams: Find Items From One List Based On Values From Another List](https://www.baeldung.com/java-streams-find-list-items)
8+
- [A Guide to the Java LinkedList](http://www.baeldung.com/java-linkedlist)
9+
- [Java List UnsupportedOperationException](http://www.baeldung.com/java-list-unsupported-operation-exception)
10+
- [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line)
11+
- [Ways to Iterate Over a List in Java](https://www.baeldung.com/java-iterate-list)
12+
- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections)
13+
- [Intersection of Two Lists in Java](https://www.baeldung.com/java-lists-intersection)
14+
- [Determine If All Elements Are the Same in a Java List](https://www.baeldung.com/java-list-all-equal)
15+
- [List of Primitive Integer Values in Java](https://www.baeldung.com/java-list-primitive-int)
16+
- [Performance Comparison of Primitive Lists in Java](https://www.baeldung.com/java-list-primitive-performance)
17+
- [Filtering a Java Collection by a List](https://www.baeldung.com/java-filter-collection-by-list)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>core-java-collections-list-2</artifactId>
5+
<version>0.1.0-SNAPSHOT</version>
6+
<name>core-java-collections-list-2</name>
7+
<packaging>jar</packaging>
8+
9+
<parent>
10+
<groupId>com.baeldung</groupId>
11+
<artifactId>parent-java</artifactId>
12+
<version>0.0.1-SNAPSHOT</version>
13+
<relativePath>../../parent-java</relativePath>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.apache.commons</groupId>
19+
<artifactId>commons-collections4</artifactId>
20+
<version>${commons-collections4.version}</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>org.apache.commons</groupId>
24+
<artifactId>commons-lang3</artifactId>
25+
<version>${commons-lang3.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.assertj</groupId>
29+
<artifactId>assertj-core</artifactId>
30+
<version>${assertj.version}</version>
31+
<scope>test</scope>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.projectlombok</groupId>
35+
<artifactId>lombok</artifactId>
36+
<version>${lombok.version}</version>
37+
<scope>provided</scope>
38+
</dependency>
39+
40+
<dependency>
41+
<groupId>net.sf.trove4j</groupId>
42+
<artifactId>trove4j</artifactId>
43+
<version>${trove4j.version}</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>it.unimi.dsi</groupId>
47+
<artifactId>fastutil</artifactId>
48+
<version>${fastutil.version}</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>colt</groupId>
52+
<artifactId>colt</artifactId>
53+
<version>${colt.version}</version>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.openjdk.jmh</groupId>
58+
<artifactId>jmh-core</artifactId>
59+
<version>${jmh-core.version}</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.openjdk.jmh</groupId>
63+
<artifactId>jmh-generator-annprocess</artifactId>
64+
<version>${jmh-core.version}</version>
65+
</dependency>
66+
</dependencies>
67+
68+
<properties>
69+
<commons-collections4.version>4.1</commons-collections4.version>
70+
<commons-lang3.version>3.8.1</commons-lang3.version>
71+
<assertj.version>3.11.1</assertj.version>
72+
<trove4j.version>3.0.2</trove4j.version>
73+
<fastutil.version>8.1.0</fastutil.version>
74+
<colt.version>1.2.0</colt.version>
75+
</properties>
76+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<encoder>
5+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6+
</pattern>
7+
</encoder>
8+
</appender>
9+
10+
<root level="INFO">
11+
<appender-ref ref="STDOUT" />
12+
</root>
13+
</configuration>

core-java-modules/core-java-collections-list/README.md

+1-18
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,14 @@
33
## Core Java Collections List Cookbooks and Examples
44

55
### Relevant Articles:
6-
- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list)
7-
- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist)
86
- [Java – Get Random Item/Element From a List](http://www.baeldung.com/java-random-list-element)
97
- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list)
108
- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list)
119
- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list)
1210
- [Iterating Backward Through a List](http://www.baeldung.com/java-list-iterate-backwards)
13-
- [Add Multiple Items to an Java ArrayList](http://www.baeldung.com/java-add-items-array-list)
1411
- [Remove the First Element from a List](http://www.baeldung.com/java-remove-first-element-from-list)
1512
- [How to Find an Element in a List with Java](http://www.baeldung.com/find-list-element-java)
1613
- [Copy a List to Another List in Java](http://www.baeldung.com/java-copy-list-to-another)
1714
- [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max)
1815
- [Collections.emptyList() vs. New List Instance](https://www.baeldung.com/java-collections-emptylist-new-list)
19-
- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list)
20-
- [Check If Two Lists are Equal in Java](http://www.baeldung.com/java-test-a-list-for-ordinality-and-equality)
21-
- [Java 8 Streams: Find Items From One List Based On Values From Another List](https://www.baeldung.com/java-streams-find-list-items)
22-
- [A Guide to the Java LinkedList](http://www.baeldung.com/java-linkedlist)
23-
- [Java List UnsupportedOperationException](http://www.baeldung.com/java-list-unsupported-operation-exception)
24-
- [Java List Initialization in One Line](https://www.baeldung.com/java-init-list-one-line)
25-
- [Ways to Iterate Over a List in Java](https://www.baeldung.com/java-iterate-list)
26-
- [ClassCastException: Arrays$ArrayList cannot be cast to ArrayList](https://www.baeldung.com/java-classcastexception-arrays-arraylist)
27-
- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections)
28-
- [Intersection of Two Lists in Java](https://www.baeldung.com/java-lists-intersection)
29-
- [Multi Dimensional ArrayList in Java](https://www.baeldung.com/java-multi-dimensional-arraylist)
30-
- [Determine If All Elements Are the Same in a Java List](https://www.baeldung.com/java-list-all-equal)
31-
- [List of Primitive Integer Values in Java](https://www.baeldung.com/java-list-primitive-int)
32-
- [Performance Comparison of Primitive Lists in Java](https://www.baeldung.com/java-list-primitive-performance)
33-
- [Filtering a Java Collection by a List](https://www.baeldung.com/java-filter-collection-by-list)
16+
- [Remove All Occurrences of a Specific Value from a List](https://www.baeldung.com/java-remove-value-from-list)

core-java-modules/core-java-collections-list/pom.xml

-30
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,12 @@
3636
<version>${lombok.version}</version>
3737
<scope>provided</scope>
3838
</dependency>
39-
40-
<dependency>
41-
<groupId>net.sf.trove4j</groupId>
42-
<artifactId>trove4j</artifactId>
43-
<version>${trove4j.version}</version>
44-
</dependency>
45-
<dependency>
46-
<groupId>it.unimi.dsi</groupId>
47-
<artifactId>fastutil</artifactId>
48-
<version>${fastutil.version}</version>
49-
</dependency>
50-
<dependency>
51-
<groupId>colt</groupId>
52-
<artifactId>colt</artifactId>
53-
<version>${colt.version}</version>
54-
</dependency>
55-
56-
<dependency>
57-
<groupId>org.openjdk.jmh</groupId>
58-
<artifactId>jmh-core</artifactId>
59-
<version>${jmh-core.version}</version>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.openjdk.jmh</groupId>
63-
<artifactId>jmh-generator-annprocess</artifactId>
64-
<version>${jmh-core.version}</version>
65-
</dependency>
6639
</dependencies>
6740

6841
<properties>
6942
<commons-collections4.version>4.1</commons-collections4.version>
7043
<commons-lang3.version>3.8.1</commons-lang3.version>
71-
<avaitility.version>1.7.0</avaitility.version>
7244
<assertj.version>3.11.1</assertj.version>
7345
<trove4j.version>3.0.2</trove4j.version>
74-
<fastutil.version>8.1.0</fastutil.version>
75-
<colt.version>1.2.0</colt.version>
7646
</properties>
7747
</project>

pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@
386386
<module>core-java-modules/core-java-arrays</module>
387387
<module>core-java-modules/core-java-collections</module>
388388
<module>core-java-modules/core-java-collections-list</module>
389+
<module>core-java-modules/core-java-collections-list-2</module>
390+
<module>core-java-modules/core-java-collections-array-list</module>
389391
<module>core-java-modules/core-java-collections-set</module>
390392
<module>core-java-modules/core-java-concurrency-basic</module>
391393
<module>core-java-modules/core-java-concurrency-collections</module>
@@ -1066,6 +1068,8 @@
10661068
<module>core-java-modules/core-java-arrays</module>
10671069
<module>core-java-modules/core-java-collections</module>
10681070
<module>core-java-modules/core-java-collections-list</module>
1071+
<module>core-java-modules/core-java-collections-list-2</module>
1072+
<module>core-java-modules/core-java-collections-array-list</module>
10691073
<module>core-java-modules/core-java-collections-set</module>
10701074
<module>core-java-modules/core-java-concurrency-basic</module>
10711075
<module>core-java-modules/core-java-concurrency-collections</module>

0 commit comments

Comments
 (0)