diff --git a/.gitignore b/.gitignore
index adb46c5..6655a49 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,9 @@
# IDE files
-/.idea/*
-!/.idea/codeStyles/
+/.idea/dictionaries
+/.idea/inspectionProfiles
+/.idea/shelf
+/.idea/libraries
+/.idea/*.xml
# Maven target
/_target
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 008692a..d22d914 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -153,6 +153,7 @@
+
+
+
-
-
+
@@ -503,10 +505,12 @@
-
-
+
+
+
-
+
+
@@ -526,6 +530,7 @@
true
true
+ true
true
@@ -536,6 +541,7 @@
true
+ true
true
@@ -545,7 +551,9 @@
- true
+ true
+ main
+ true
true
@@ -555,8 +563,7 @@
- true
- main
+ true
true
@@ -567,7 +574,19 @@
true
- true
+ false
+ true
+
+
+
+
+
+
+
+
+ true
+ false
+ true
@@ -575,14 +594,20 @@
- true
+
+ true
+ false
+
- true
+
+ true
+ false
+
@@ -605,11 +630,48 @@
true
+ true
true
+
+
+
+
+ true
+ hashCode
+ true
+ false
+
+
+
+
+
+
+
+
+ true
+ equals
+ true
+ false
+
+
+
+
+
+
+
+
+ true
+ toString
+ true
+ false
+
+
+
+
@@ -722,7 +784,6 @@
-
diff --git a/.idea/mutable-library.iml b/.idea/mutable-library.iml
new file mode 100644
index 0000000..c3ff347
--- /dev/null
+++ b/.idea/mutable-library.iml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Mutable_Tests.xml b/.idea/runConfigurations/Mutable_Tests.xml
new file mode 100644
index 0000000..af67d6a
--- /dev/null
+++ b/.idea/runConfigurations/Mutable_Tests.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/compile_check.xml b/.idea/runConfigurations/compile_check.xml
new file mode 100644
index 0000000..9103897
--- /dev/null
+++ b/.idea/runConfigurations/compile_check.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/repackage_java8_jdk8.xml b/.idea/runConfigurations/repackage_java8_jdk8.xml
new file mode 100644
index 0000000..a79d24a
--- /dev/null
+++ b/.idea/runConfigurations/repackage_java8_jdk8.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main-github/latest-release-notes.md b/main-github/release-notes/2.0.0.md
similarity index 93%
rename from main-github/latest-release-notes.md
rename to main-github/release-notes/2.0.0.md
index c484973..4c5aa44 100644
--- a/main-github/latest-release-notes.md
+++ b/main-github/release-notes/2.0.0.md
@@ -1,4 +1,4 @@
-Release Notes v2.0.0
+# Release Notes v2.0.0
- Updated Copyright for 2020.
- Updated JavaDoc for MutableValue class.
diff --git a/main-github/release-notes/3.0.0.md b/main-github/release-notes/3.0.0.md
new file mode 100644
index 0000000..25ef5bb
--- /dev/null
+++ b/main-github/release-notes/3.0.0.md
@@ -0,0 +1,12 @@
+# Release Notes v3.0.0
+
+- Updated project to use single base package.
+- Updated code coverage for Place Holder interface default methods.
+- Updated Maven project file.
+ - Added project details.
+ - Updated plugin versions.
+ - Updated JUnit dependency.
+- Updated git ignore file.
+- Added IntelliJ project files.
+ - Added project file.
+ - Added code style.
diff --git a/main-java/app/zoftwhere/mutable/MutableTransformer0.java b/main-java/app/zoftwhere/mutable/collection/MutableTransformer0.java
similarity index 80%
rename from main-java/app/zoftwhere/mutable/MutableTransformer0.java
rename to main-java/app/zoftwhere/mutable/collection/MutableTransformer0.java
index 01b301c..9b8aef5 100644
--- a/main-java/app/zoftwhere/mutable/MutableTransformer0.java
+++ b/main-java/app/zoftwhere/mutable/collection/MutableTransformer0.java
@@ -1,9 +1,9 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.function.Function;
-import app.zoftwhere.function.Consumer0;
-import app.zoftwhere.function.Transformer0;
+import app.zoftwhere.mutable.function.Consumer0;
+import app.zoftwhere.mutable.function.Transformer0;
public class MutableTransformer0 extends MutableValue implements Transformer0 {
diff --git a/main-java/app/zoftwhere/mutable/MutableTransformer1.java b/main-java/app/zoftwhere/mutable/collection/MutableTransformer1.java
similarity index 80%
rename from main-java/app/zoftwhere/mutable/MutableTransformer1.java
rename to main-java/app/zoftwhere/mutable/collection/MutableTransformer1.java
index fab02b6..7b8bb05 100644
--- a/main-java/app/zoftwhere/mutable/MutableTransformer1.java
+++ b/main-java/app/zoftwhere/mutable/collection/MutableTransformer1.java
@@ -1,9 +1,9 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.function.Function;
-import app.zoftwhere.function.Consumer1;
-import app.zoftwhere.function.Transformer1;
+import app.zoftwhere.mutable.function.Consumer1;
+import app.zoftwhere.mutable.function.Transformer1;
public class MutableTransformer1 extends MutableValue implements Transformer1 {
diff --git a/main-java/app/zoftwhere/mutable/MutableTransformer2.java b/main-java/app/zoftwhere/mutable/collection/MutableTransformer2.java
similarity index 82%
rename from main-java/app/zoftwhere/mutable/MutableTransformer2.java
rename to main-java/app/zoftwhere/mutable/collection/MutableTransformer2.java
index 21c10df..8b16440 100644
--- a/main-java/app/zoftwhere/mutable/MutableTransformer2.java
+++ b/main-java/app/zoftwhere/mutable/collection/MutableTransformer2.java
@@ -1,9 +1,9 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.function.Function;
-import app.zoftwhere.function.Consumer2;
-import app.zoftwhere.function.Transformer2;
+import app.zoftwhere.mutable.function.Consumer2;
+import app.zoftwhere.mutable.function.Transformer2;
public class MutableTransformer2 extends MutableValue implements Transformer2 {
diff --git a/main-java/app/zoftwhere/mutable/MutableTransformer3.java b/main-java/app/zoftwhere/mutable/collection/MutableTransformer3.java
similarity index 82%
rename from main-java/app/zoftwhere/mutable/MutableTransformer3.java
rename to main-java/app/zoftwhere/mutable/collection/MutableTransformer3.java
index 0b0c892..034b4a6 100644
--- a/main-java/app/zoftwhere/mutable/MutableTransformer3.java
+++ b/main-java/app/zoftwhere/mutable/collection/MutableTransformer3.java
@@ -1,9 +1,9 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.function.Function;
-import app.zoftwhere.function.Consumer3;
-import app.zoftwhere.function.Transformer3;
+import app.zoftwhere.mutable.function.Consumer3;
+import app.zoftwhere.mutable.function.Transformer3;
public class MutableTransformer3 extends MutableValue implements Transformer3 {
diff --git a/main-java/app/zoftwhere/mutable/MutableTransformer4.java b/main-java/app/zoftwhere/mutable/collection/MutableTransformer4.java
similarity index 83%
rename from main-java/app/zoftwhere/mutable/MutableTransformer4.java
rename to main-java/app/zoftwhere/mutable/collection/MutableTransformer4.java
index 2d813de..f2a69b5 100644
--- a/main-java/app/zoftwhere/mutable/MutableTransformer4.java
+++ b/main-java/app/zoftwhere/mutable/collection/MutableTransformer4.java
@@ -1,9 +1,9 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.function.Function;
-import app.zoftwhere.function.Consumer4;
-import app.zoftwhere.function.Transformer4;
+import app.zoftwhere.mutable.function.Consumer4;
+import app.zoftwhere.mutable.function.Transformer4;
public class MutableTransformer4 extends MutableValue implements Transformer4 {
diff --git a/main-java/app/zoftwhere/mutable/MutableValue.java b/main-java/app/zoftwhere/mutable/collection/MutableValue.java
similarity index 94%
rename from main-java/app/zoftwhere/mutable/MutableValue.java
rename to main-java/app/zoftwhere/mutable/collection/MutableValue.java
index 2a062e3..3b44ab1 100644
--- a/main-java/app/zoftwhere/mutable/MutableValue.java
+++ b/main-java/app/zoftwhere/mutable/collection/MutableValue.java
@@ -1,9 +1,9 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.NoSuchElementException;
import java.util.Optional;
-import app.zoftwhere.function.PlaceHolder;
+import app.zoftwhere.mutable.function.PlaceHolder;
/**
* A mutable value.
@@ -12,8 +12,6 @@
*/
public class MutableValue implements PlaceHolder {
- private T value;
-
/**
* Returns a {@code MutableValue} describing the given value.
*
@@ -35,6 +33,8 @@ public static MutableValue empty() {
return new MutableValue<>();
}
+ private T value;
+
/**
* Constructs a mutable value with initial value of null.
*/
@@ -64,7 +64,7 @@ public Void set(T value) {
* Retrieve mutable value.
*
* @return Stored value
- * @exception NoSuchElementException if no value is present
+ * @throws NoSuchElementException if no value is present
*/
@Override
public T get() {
diff --git a/main-java/app/zoftwhere/mutable/OverlayList.java b/main-java/app/zoftwhere/mutable/collection/OverlayList.java
similarity index 99%
rename from main-java/app/zoftwhere/mutable/OverlayList.java
rename to main-java/app/zoftwhere/mutable/collection/OverlayList.java
index 4248dc3..81a2ef4 100644
--- a/main-java/app/zoftwhere/mutable/OverlayList.java
+++ b/main-java/app/zoftwhere/mutable/collection/OverlayList.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/main-java/app/zoftwhere/function/Consumer0.java b/main-java/app/zoftwhere/mutable/function/Consumer0.java
similarity index 56%
rename from main-java/app/zoftwhere/function/Consumer0.java
rename to main-java/app/zoftwhere/mutable/function/Consumer0.java
index f36db7a..b107275 100644
--- a/main-java/app/zoftwhere/function/Consumer0.java
+++ b/main-java/app/zoftwhere/mutable/function/Consumer0.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Consumer0 {
diff --git a/main-java/app/zoftwhere/function/Consumer1.java b/main-java/app/zoftwhere/mutable/function/Consumer1.java
similarity index 74%
rename from main-java/app/zoftwhere/function/Consumer1.java
rename to main-java/app/zoftwhere/mutable/function/Consumer1.java
index 26997e6..cdf3680 100644
--- a/main-java/app/zoftwhere/function/Consumer1.java
+++ b/main-java/app/zoftwhere/mutable/function/Consumer1.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
import java.util.function.Consumer;
diff --git a/main-java/app/zoftwhere/function/Consumer2.java b/main-java/app/zoftwhere/mutable/function/Consumer2.java
similarity index 64%
rename from main-java/app/zoftwhere/function/Consumer2.java
rename to main-java/app/zoftwhere/mutable/function/Consumer2.java
index 7a7e34c..f677af6 100644
--- a/main-java/app/zoftwhere/function/Consumer2.java
+++ b/main-java/app/zoftwhere/mutable/function/Consumer2.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Consumer2 {
diff --git a/main-java/app/zoftwhere/function/Consumer3.java b/main-java/app/zoftwhere/mutable/function/Consumer3.java
similarity index 67%
rename from main-java/app/zoftwhere/function/Consumer3.java
rename to main-java/app/zoftwhere/mutable/function/Consumer3.java
index 82aab17..b1b6258 100644
--- a/main-java/app/zoftwhere/function/Consumer3.java
+++ b/main-java/app/zoftwhere/mutable/function/Consumer3.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Consumer3 {
diff --git a/main-java/app/zoftwhere/function/Consumer4.java b/main-java/app/zoftwhere/mutable/function/Consumer4.java
similarity index 70%
rename from main-java/app/zoftwhere/function/Consumer4.java
rename to main-java/app/zoftwhere/mutable/function/Consumer4.java
index 49ef5e8..3aea3c4 100644
--- a/main-java/app/zoftwhere/function/Consumer4.java
+++ b/main-java/app/zoftwhere/mutable/function/Consumer4.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Consumer4 {
diff --git a/main-java/app/zoftwhere/function/PlaceHolder.java b/main-java/app/zoftwhere/mutable/function/PlaceHolder.java
similarity index 91%
rename from main-java/app/zoftwhere/function/PlaceHolder.java
rename to main-java/app/zoftwhere/mutable/function/PlaceHolder.java
index 674360f..4bd170c 100644
--- a/main-java/app/zoftwhere/function/PlaceHolder.java
+++ b/main-java/app/zoftwhere/mutable/function/PlaceHolder.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
import java.util.Optional;
import java.util.function.Supplier;
diff --git a/main-java/app/zoftwhere/function/Receiver.java b/main-java/app/zoftwhere/mutable/function/Receiver.java
similarity index 67%
rename from main-java/app/zoftwhere/function/Receiver.java
rename to main-java/app/zoftwhere/mutable/function/Receiver.java
index 5a799d7..1dbe500 100644
--- a/main-java/app/zoftwhere/function/Receiver.java
+++ b/main-java/app/zoftwhere/mutable/function/Receiver.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
@SuppressWarnings("unused")
public interface Receiver {
diff --git a/main-java/app/zoftwhere/function/ThrowingConsumer0.java b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer0.java
similarity index 65%
rename from main-java/app/zoftwhere/function/ThrowingConsumer0.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingConsumer0.java
index 2f299e7..966e946 100644
--- a/main-java/app/zoftwhere/function/ThrowingConsumer0.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer0.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingConsumer0 {
diff --git a/main-java/app/zoftwhere/function/ThrowingConsumer1.java b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer1.java
similarity index 67%
rename from main-java/app/zoftwhere/function/ThrowingConsumer1.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingConsumer1.java
index 570b9d6..c0a8120 100644
--- a/main-java/app/zoftwhere/function/ThrowingConsumer1.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer1.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingConsumer1 {
diff --git a/main-java/app/zoftwhere/function/ThrowingConsumer2.java b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer2.java
similarity index 70%
rename from main-java/app/zoftwhere/function/ThrowingConsumer2.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingConsumer2.java
index 7c4cefb..a7523ca 100644
--- a/main-java/app/zoftwhere/function/ThrowingConsumer2.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer2.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingConsumer2 {
diff --git a/main-java/app/zoftwhere/function/ThrowingConsumer3.java b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer3.java
similarity index 72%
rename from main-java/app/zoftwhere/function/ThrowingConsumer3.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingConsumer3.java
index 35608a6..f4e0012 100644
--- a/main-java/app/zoftwhere/function/ThrowingConsumer3.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer3.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingConsumer3 {
diff --git a/main-java/app/zoftwhere/function/ThrowingConsumer4.java b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer4.java
similarity index 74%
rename from main-java/app/zoftwhere/function/ThrowingConsumer4.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingConsumer4.java
index 7c24380..13b689e 100644
--- a/main-java/app/zoftwhere/function/ThrowingConsumer4.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingConsumer4.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingConsumer4 {
diff --git a/main-java/app/zoftwhere/function/ThrowingFunction0.java b/main-java/app/zoftwhere/mutable/function/ThrowingFunction0.java
similarity index 65%
rename from main-java/app/zoftwhere/function/ThrowingFunction0.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingFunction0.java
index 7a80d78..bbf5dd1 100644
--- a/main-java/app/zoftwhere/function/ThrowingFunction0.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingFunction0.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingFunction0 {
diff --git a/main-java/app/zoftwhere/function/ThrowingFunction1.java b/main-java/app/zoftwhere/mutable/function/ThrowingFunction1.java
similarity index 67%
rename from main-java/app/zoftwhere/function/ThrowingFunction1.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingFunction1.java
index a71b527..6f1bf63 100644
--- a/main-java/app/zoftwhere/function/ThrowingFunction1.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingFunction1.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingFunction1 {
diff --git a/main-java/app/zoftwhere/function/ThrowingFunction2.java b/main-java/app/zoftwhere/mutable/function/ThrowingFunction2.java
similarity index 70%
rename from main-java/app/zoftwhere/function/ThrowingFunction2.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingFunction2.java
index a8ae646..40695b9 100644
--- a/main-java/app/zoftwhere/function/ThrowingFunction2.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingFunction2.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingFunction2 {
diff --git a/main-java/app/zoftwhere/function/ThrowingFunction3.java b/main-java/app/zoftwhere/mutable/function/ThrowingFunction3.java
similarity index 72%
rename from main-java/app/zoftwhere/function/ThrowingFunction3.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingFunction3.java
index 16a1dfe..7e6edb4 100644
--- a/main-java/app/zoftwhere/function/ThrowingFunction3.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingFunction3.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingFunction3 {
diff --git a/main-java/app/zoftwhere/function/ThrowingFunction4.java b/main-java/app/zoftwhere/mutable/function/ThrowingFunction4.java
similarity index 74%
rename from main-java/app/zoftwhere/function/ThrowingFunction4.java
rename to main-java/app/zoftwhere/mutable/function/ThrowingFunction4.java
index 3fa7754..4f20095 100644
--- a/main-java/app/zoftwhere/function/ThrowingFunction4.java
+++ b/main-java/app/zoftwhere/mutable/function/ThrowingFunction4.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface ThrowingFunction4 {
diff --git a/main-java/app/zoftwhere/function/Transformer0.java b/main-java/app/zoftwhere/mutable/function/Transformer0.java
similarity index 64%
rename from main-java/app/zoftwhere/function/Transformer0.java
rename to main-java/app/zoftwhere/mutable/function/Transformer0.java
index a49f958..1720ee2 100644
--- a/main-java/app/zoftwhere/function/Transformer0.java
+++ b/main-java/app/zoftwhere/mutable/function/Transformer0.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Transformer0 extends Consumer0, PlaceHolder {
diff --git a/main-java/app/zoftwhere/function/Transformer1.java b/main-java/app/zoftwhere/mutable/function/Transformer1.java
similarity index 66%
rename from main-java/app/zoftwhere/function/Transformer1.java
rename to main-java/app/zoftwhere/mutable/function/Transformer1.java
index 6c9ed62..b13d8cc 100644
--- a/main-java/app/zoftwhere/function/Transformer1.java
+++ b/main-java/app/zoftwhere/mutable/function/Transformer1.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Transformer1 extends Consumer1, PlaceHolder {
diff --git a/main-java/app/zoftwhere/function/Transformer2.java b/main-java/app/zoftwhere/mutable/function/Transformer2.java
similarity index 68%
rename from main-java/app/zoftwhere/function/Transformer2.java
rename to main-java/app/zoftwhere/mutable/function/Transformer2.java
index 46dfa28..8cf3c81 100644
--- a/main-java/app/zoftwhere/function/Transformer2.java
+++ b/main-java/app/zoftwhere/mutable/function/Transformer2.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Transformer2 extends Consumer2, PlaceHolder {
diff --git a/main-java/app/zoftwhere/function/Transformer3.java b/main-java/app/zoftwhere/mutable/function/Transformer3.java
similarity index 70%
rename from main-java/app/zoftwhere/function/Transformer3.java
rename to main-java/app/zoftwhere/mutable/function/Transformer3.java
index d9be00d..74c5e9f 100644
--- a/main-java/app/zoftwhere/function/Transformer3.java
+++ b/main-java/app/zoftwhere/mutable/function/Transformer3.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Transformer3 extends Consumer3, PlaceHolder {
diff --git a/main-java/app/zoftwhere/function/Transformer4.java b/main-java/app/zoftwhere/mutable/function/Transformer4.java
similarity index 72%
rename from main-java/app/zoftwhere/function/Transformer4.java
rename to main-java/app/zoftwhere/mutable/function/Transformer4.java
index 93f4261..afeaccd 100644
--- a/main-java/app/zoftwhere/function/Transformer4.java
+++ b/main-java/app/zoftwhere/mutable/function/Transformer4.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
public interface Transformer4 extends Consumer4, PlaceHolder {
diff --git a/main-jpms/module-info.java b/main-jpms/module-info.java
index 026922e..b5ba9af 100644
--- a/main-jpms/module-info.java
+++ b/main-jpms/module-info.java
@@ -1,4 +1,4 @@
module zoftwhere.mutable.library {
- exports app.zoftwhere.mutable;
- exports app.zoftwhere.function;
+ exports app.zoftwhere.mutable.collection;
+ exports app.zoftwhere.mutable.function;
}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 70149d2..5090462 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,14 @@
app.zoftwhere.mutable
mutable-library
- 2.0.0
+ 3.0.0
+
+ ZoftWhere
+ https://github.com/ZoftWhere
+
+ zoftwhere.mutable.library
+ A library for mutable values.
+ https://github.com/ZoftWhere/mutable-library
@@ -17,22 +24,27 @@
8
11
+
+ yyyy-MM-dd'T'HH:mm:ss'Z'
+
3.1.0
3.8.1
- 3.1.1
+ 3.1.2
3.0.0-M1
3.0.0-M1
- 3.1.2
- 3.1.1
- 3.1.0
- 3.8.2
- 3.1.0
- 3.0.0-M3
+ 3.2.0
+ 3.2.0
+ 3.1.1
+ 3.2.0
+ 3.9.1
+ 3.2.1
+ 3.0.0-M5
3.0.0
- 5.4.2
+ false
+ 5.6.2
@@ -48,9 +60,22 @@
+
+ org.junit.platform
+ junit-platform-launcher
+ test
+ true
+
+
+
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
org.junit.jupiter
- junit-jupiter-engine
+ junit-jupiter-api
test
@@ -101,7 +126,22 @@
compile
+
${maven.compiler.test-jdk}
+
+ ${project.basedir}/main-java
+ ${project.basedir}/main-jpms
+
+
+
+
+ main-compile-check
+ none
+
+ compile
+
+
+ ${maven.compiler.main-jdk}
@@ -176,13 +216,36 @@
org.apache.maven.plugins
maven-surefire-plugin
${maven-surefire-plugin.version}
-
-
- 0
- false
- false
- false
-
+
+
+ default-test
+ test
+
+ test
+
+
+
+
+ --add-opens zoftwhere.mutable.library/app.zoftwhere.mutable.function=ALL-UNNAMED
+ --add-opens zoftwhere.mutable.library/app.zoftwhere.mutable.collection=ALL-UNNAMED
+
+ --add-opens zoftwhere.mutable.library/app.zoftwhere.mutable.scope=ALL-UNNAMED
+ --add-opens zoftwhere.mutable.library/app.zoftwhere.mutable.example=ALL-UNNAMED
+ --add-opens zoftwhere.mutable.library/example=ALL-UNNAMED
+
+ 1
+ true
+ false
+ ${surefire.printSummary}
+
+
+ app/zoftwhere/mutable/**/*Test.java
+
+ example/*.java
+
+
+
+
@@ -210,6 +273,7 @@
jar
+ true
false
@@ -230,11 +294,12 @@
false
false
+ true
+ false
+ false
-
-
-
+ ${maven.build.timestamp}
${project.artifactId}
${project.groupId}
${project.version}
@@ -246,6 +311,18 @@
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+ ${maven-project-info-reports-plugin.version}
+
+
+
+ org.apache.maven.plugins
+ maven-site-plugin
+ ${maven-site-plugin.version}
+
+
org.apache.maven.plugins
maven-javadoc-plugin
@@ -258,26 +335,94 @@
jar
+
+ ${maven.compiler.main-jdk}
+
true
+ true
+
module-info.java
+
+
+
+
+ main-javadoc-jdk8
+ none
+
+ javadoc
+ jar
+
+
+ true
+ true
+
+
+ module-info.java
+
+
+
+
+
+ main-javadoc-check
+ none
+
+ javadoc
+
+
+
+ ${maven.compiler.main-jdk}
+
+ all
+ private
+ true
+
+
+ module-info.java
+
+
test-javadoc
none
+ test-javadoc
test-jar
+
+ ${maven.compiler.test-jdk}
+
false
+ true
+
+
+ module-info.java
+
+
true
true
+
+ false
+
+ false
+
+
+ ${maven.build.timestamp}
+ ${project.artifactId}
+ ${project.groupId}
+ ${project.version}
+ ${project.artifactId}
+ ${project.groupId}
+ ${project.version}
+
+
@@ -308,6 +453,21 @@
+
+ false
+
+ false
+
+
+ ${maven.build.timestamp}
+ ${project.artifactId}
+ ${project.groupId}
+ ${project.version}
+ ${project.artifactId}
+ ${project.groupId}
+ ${project.version}
+
+
diff --git a/readme.md b/readme.md
index f746653..807d44d 100644
--- a/readme.md
+++ b/readme.md
@@ -1,5 +1,8 @@
# ZoftWhere Mutable Library
-![Language](https://img.shields.io/github/languages/top/ZoftWhere/mutable-library) [![License](https://img.shields.io/github/license/ZoftWhere/mutable-library)](https://github.com/ZoftWhere/mutable-library/blob/master/license.txt) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/ZoftWhere/mutable-library) ![GitHub Release Date](https://img.shields.io/github/release-date/ZoftWhere/mutable-library)
+![Language](https://img.shields.io/github/languages/top/ZoftWhere/mutable-library)
+[![License](https://img.shields.io/github/license/ZoftWhere/mutable-library)](https://github.com/ZoftWhere/mutable-library/blob/master/license.txt)
+![GitHub release (latest by date)](https://img.shields.io/github/v/release/ZoftWhere/mutable-library)
+![GitHub Release Date](https://img.shields.io/github/release-date/ZoftWhere/mutable-library)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/ZoftWhere/mutable-library/master?label=master%20updated)
A library for mutable values.
@@ -20,7 +23,7 @@ If the project needs to be installed against JDK8, it can be accomplished by cal
``` shell script
mvn clean compiler:compile@main-compile-jdk8 jar:jar@main-jar build-helper:add-source@main-jpms source:jar@main-sources javadoc:jar@main-javadoc moditect:add-module-info@main-jpms install:install-file@main-install
-```
+```
## Examples
diff --git a/test-java/app/zoftwhere/function/PlaceHolderTest.java b/test-java/app/zoftwhere/function/PlaceHolderTest.java
deleted file mode 100644
index f0ae1e0..0000000
--- a/test-java/app/zoftwhere/function/PlaceHolderTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package app.zoftwhere.function;
-
-import java.util.Optional;
-
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-class PlaceHolderTest {
-
- @Test
- void testIsEmpty() {
- final var placeHolder = new PlaceHolder() {
- String internal = null;
-
- @Override
- public Optional optional() {
- return Optional.empty();
- }
-
- @Override
- public boolean isPresent() {
- return internal != null;
- }
-
- @Override
- public Void set(String value) {
- internal = value;
- return null;
- }
-
- @Override
- public String get() {
- return internal;
- }
- };
-
- assertNotNull(placeHolder);
- assertFalse(placeHolder.isPresent());
- assertTrue(placeHolder.isEmpty());
-
- placeHolder.set("test");
- assertEquals("test", placeHolder.get());
- }
-
-}
\ No newline at end of file
diff --git a/test-java/app/zoftwhere/function/scope/ThrowingFunctionScopeTest.java b/test-java/app/zoftwhere/function/scope/ThrowingFunctionScopeTest.java
deleted file mode 100644
index 4ef4ef6..0000000
--- a/test-java/app/zoftwhere/function/scope/ThrowingFunctionScopeTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package app.zoftwhere.function.scope;
-
-import app.zoftwhere.function.ThrowingFunction0;
-import app.zoftwhere.function.ThrowingFunction1;
-import app.zoftwhere.function.ThrowingFunction2;
-import app.zoftwhere.function.ThrowingFunction3;
-import app.zoftwhere.function.ThrowingFunction4;
-import org.junit.jupiter.api.Test;
-
-class ThrowingFunctionScopeTest {
-
- @Test
- void testScope() {
- final ThrowingFunction0 tf0 //
- = () -> { throw new Throwable(); };
- try { tf0.accept(); }
- catch (Throwable ignored) { }
-
- final ThrowingFunction1 tf1 //
- = (t1) -> { throw new Throwable(); };
- try { tf1.accept("s1"); }
- catch (Throwable ignored) { }
-
- final ThrowingFunction2 tf2 //
- = (t1, t2) -> { throw new Throwable(); };
- try { tf2.accept("s1", "s2"); }
- catch (Throwable ignored) { }
-
- final ThrowingFunction3 tf3 //
- = (t1, t2, t3) -> { throw new Throwable(); };
- try { tf3.accept("s1", "s2", "s3"); }
- catch (Throwable ignored) { }
-
- final ThrowingFunction4 tf4 //
- = (t1, t2, t3, t4) -> { throw new Throwable(); };
- try { tf4.accept("s1", "s2", "s3", "s4"); }
- catch (Throwable ignored) { }
- }
-
-}
\ No newline at end of file
diff --git a/test-java/app/zoftwhere/mutable/MutableTransformerTest.java b/test-java/app/zoftwhere/mutable/collection/MutableTransformerTest.java
similarity index 97%
rename from test-java/app/zoftwhere/mutable/MutableTransformerTest.java
rename to test-java/app/zoftwhere/mutable/collection/MutableTransformerTest.java
index 3487035..1a870f1 100644
--- a/test-java/app/zoftwhere/mutable/MutableTransformerTest.java
+++ b/test-java/app/zoftwhere/mutable/collection/MutableTransformerTest.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.function.Supplier;
@@ -85,9 +85,9 @@ void testConsumer() {
final var m4 =
new MutableTransformer4(internal -> (t1, t2, t3, t4) -> internal
- .set(4));
+ .set(4));
m4.accept("7", "8", "9", "10");
assertEquals(4, m4.get());
}
-}
\ No newline at end of file
+}
diff --git a/test-java/app/zoftwhere/mutable/MutableValueTest.java b/test-java/app/zoftwhere/mutable/collection/MutableValueTest.java
similarity index 98%
rename from test-java/app/zoftwhere/mutable/MutableValueTest.java
rename to test-java/app/zoftwhere/mutable/collection/MutableValueTest.java
index 18b0f7c..9b31749 100644
--- a/test-java/app/zoftwhere/mutable/MutableValueTest.java
+++ b/test-java/app/zoftwhere/mutable/collection/MutableValueTest.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.NoSuchElementException;
@@ -94,4 +94,4 @@ void testIsEmpty() {
assertFalse(new MutableValue<>("").isEmpty());
}
-}
\ No newline at end of file
+}
diff --git a/test-java/app/zoftwhere/mutable/OverlayListTest.java b/test-java/app/zoftwhere/mutable/collection/OverlayListTest.java
similarity index 83%
rename from test-java/app/zoftwhere/mutable/OverlayListTest.java
rename to test-java/app/zoftwhere/mutable/collection/OverlayListTest.java
index 651b79d..ccea90b 100644
--- a/test-java/app/zoftwhere/mutable/OverlayListTest.java
+++ b/test-java/app/zoftwhere/mutable/collection/OverlayListTest.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.mutable;
+package app.zoftwhere.mutable.collection;
import java.util.Arrays;
import java.util.Comparator;
@@ -52,49 +52,57 @@ void todoCreateRealTest() {
overlay.add("next");
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.add(0, "next");
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.addAll(List.of("1", "2", "3"));
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.addAll(0, List.of("1", "2", "3"));
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.remove("next");
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.remove(0);
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.removeIf(s -> true);
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.removeAll(List.of("1", "2", "3"));
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
// Replace all.
overlay.set(0, "1");
@@ -106,20 +114,23 @@ void todoCreateRealTest() {
overlay.retainAll(List.of("1", "2", "3"));
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
overlay.clear();
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
try {
//noinspection RedundantOperationOnEmptyContainer
overlay.sort(Comparator.naturalOrder());
fail("overlay.list.expected.unsupported.operation.exception");
}
- catch (UnsupportedOperationException ignore) {}
+ catch (UnsupportedOperationException ignore) {
+ }
assertNotNull(overlay.subList(0, 1));
@@ -137,4 +148,4 @@ void todoCreateRealTest() {
assertNotNull(overlay.parallelStream());
}
-}
\ No newline at end of file
+}
diff --git a/test-java/app/zoftwhere/mutable/function/PlaceHolderTest.java b/test-java/app/zoftwhere/mutable/function/PlaceHolderTest.java
new file mode 100644
index 0000000..132035b
--- /dev/null
+++ b/test-java/app/zoftwhere/mutable/function/PlaceHolderTest.java
@@ -0,0 +1,66 @@
+package app.zoftwhere.mutable.function;
+
+import java.util.Optional;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class PlaceHolderTest {
+
+ @Test
+ void testIsEmpty() {
+ final var placeHolder = new NullableString();
+
+ assertNotNull(placeHolder);
+ assertFalse(placeHolder.isPresent());
+ assertTrue(placeHolder.isEmpty());
+
+ placeHolder.set("test");
+ assertEquals("test", placeHolder.get());
+ }
+
+ @Test
+ void testGetValue() {
+ final var placeHolder = new NullableString();
+
+ assertNull(placeHolder.getValue());
+ }
+
+ @Test
+ void testOrElse() {
+ final var placeHolder = new NullableString();
+
+ assertEquals("else", placeHolder.orElse("else"));
+ }
+
+ private static class NullableString implements PlaceHolder {
+ String internal = null;
+
+ @Override
+ public Optional optional() {
+ return Optional.empty();
+ }
+
+ @Override
+ public boolean isPresent() {
+ return internal != null;
+ }
+
+ @Override
+ public Void set(String value) {
+ internal = value;
+ return null;
+ }
+
+ @Override
+ public String get() {
+ return internal;
+ }
+ }
+
+}
diff --git a/test-java/app/zoftwhere/function/ReceiverTest.java b/test-java/app/zoftwhere/mutable/function/ReceiverTest.java
similarity index 84%
rename from test-java/app/zoftwhere/function/ReceiverTest.java
rename to test-java/app/zoftwhere/mutable/function/ReceiverTest.java
index a3dec02..257050c 100644
--- a/test-java/app/zoftwhere/function/ReceiverTest.java
+++ b/test-java/app/zoftwhere/mutable/function/ReceiverTest.java
@@ -1,6 +1,6 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
-import app.zoftwhere.mutable.MutableValue;
+import app.zoftwhere.mutable.collection.MutableValue;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -21,4 +21,4 @@ public Void set(String value) {
assertEquals("set", mutable.get());
}
-}
\ No newline at end of file
+}
diff --git a/test-java/app/zoftwhere/function/ThrowingConsumerTest.java b/test-java/app/zoftwhere/mutable/function/ThrowingConsumerTest.java
similarity index 97%
rename from test-java/app/zoftwhere/function/ThrowingConsumerTest.java
rename to test-java/app/zoftwhere/mutable/function/ThrowingConsumerTest.java
index 228ecdb..7bd34bd 100644
--- a/test-java/app/zoftwhere/function/ThrowingConsumerTest.java
+++ b/test-java/app/zoftwhere/mutable/function/ThrowingConsumerTest.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
import org.junit.jupiter.api.Test;
@@ -41,4 +41,5 @@ private static void accept(Integer t1, Long t2, Float t3) throws Throwable {
@SuppressWarnings({"RedundantThrows", "EmptyMethod"})
private static void accept(Integer t1, Long t2, Float t3, Double t4) throws Throwable {
}
-}
\ No newline at end of file
+
+}
diff --git a/test-java/app/zoftwhere/function/ThrowingFunctionTest.java b/test-java/app/zoftwhere/mutable/function/ThrowingFunctionTest.java
similarity index 89%
rename from test-java/app/zoftwhere/function/ThrowingFunctionTest.java
rename to test-java/app/zoftwhere/mutable/function/ThrowingFunctionTest.java
index 780b545..eb157f4 100644
--- a/test-java/app/zoftwhere/function/ThrowingFunctionTest.java
+++ b/test-java/app/zoftwhere/mutable/function/ThrowingFunctionTest.java
@@ -1,4 +1,4 @@
-package app.zoftwhere.function;
+package app.zoftwhere.mutable.function;
import org.junit.jupiter.api.Test;
@@ -39,7 +39,8 @@ void testTypeThrow() {
tf0.accept();
fail();
}
- catch (Throwable ignored) { }
+ catch (Throwable ignored) {
+ }
final ThrowingFunction1 tf1 //
= (Integer t1) -> { throw new NullPointerException(); };
@@ -47,7 +48,8 @@ void testTypeThrow() {
tf1.accept(1);
fail();
}
- catch (Throwable ignored) { }
+ catch (Throwable ignored) {
+ }
final ThrowingFunction2 tf2 //
= (Integer t1, Long t2) -> { throw new NullPointerException(); };
@@ -55,7 +57,8 @@ void testTypeThrow() {
tf2.accept(1, 2L);
fail();
}
- catch (Throwable ignored) { }
+ catch (Throwable ignored) {
+ }
final ThrowingFunction3 tf3 //
= (Integer t1, Long t2, Float t3) -> { throw new NullPointerException(); };
@@ -63,7 +66,8 @@ void testTypeThrow() {
tf3.accept(1, 2L, 3f);
fail();
}
- catch (Throwable ignored) { }
+ catch (Throwable ignored) {
+ }
final ThrowingFunction4 tf4 //
= (Integer t1, Long t2, Float t3, Double t4) -> { throw new NullPointerException(); };
@@ -71,7 +75,8 @@ void testTypeThrow() {
tf4.accept(1, 2L, 3f, 4d);
fail();
}
- catch (Throwable ignored) { }
+ catch (Throwable ignored) {
+ }
}
}
diff --git a/test-java/app/zoftwhere/mutable/scope/MutableTransformerScopeTest.java b/test-java/app/zoftwhere/mutable/scope/MutableTransformerScopeTest.java
index 8dd0026..1e75624 100644
--- a/test-java/app/zoftwhere/mutable/scope/MutableTransformerScopeTest.java
+++ b/test-java/app/zoftwhere/mutable/scope/MutableTransformerScopeTest.java
@@ -1,10 +1,10 @@
package app.zoftwhere.mutable.scope;
-import app.zoftwhere.mutable.MutableTransformer0;
-import app.zoftwhere.mutable.MutableTransformer1;
-import app.zoftwhere.mutable.MutableTransformer2;
-import app.zoftwhere.mutable.MutableTransformer3;
-import app.zoftwhere.mutable.MutableTransformer4;
+import app.zoftwhere.mutable.collection.MutableTransformer0;
+import app.zoftwhere.mutable.collection.MutableTransformer1;
+import app.zoftwhere.mutable.collection.MutableTransformer2;
+import app.zoftwhere.mutable.collection.MutableTransformer3;
+import app.zoftwhere.mutable.collection.MutableTransformer4;
import org.junit.jupiter.api.Test;
class MutableTransformerScopeTest {
diff --git a/test-java/app/zoftwhere/mutable/scope/MutableValueScopeTest.java b/test-java/app/zoftwhere/mutable/scope/MutableValueScopeTest.java
index 4205bc2..e918f0c 100644
--- a/test-java/app/zoftwhere/mutable/scope/MutableValueScopeTest.java
+++ b/test-java/app/zoftwhere/mutable/scope/MutableValueScopeTest.java
@@ -1,6 +1,6 @@
package app.zoftwhere.mutable.scope;
-import app.zoftwhere.mutable.MutableValue;
+import app.zoftwhere.mutable.collection.MutableValue;
import org.junit.jupiter.api.Test;
class MutableValueScopeTest {
diff --git a/test-java/app/zoftwhere/function/scope/ThrowingConsumerScopeTest.java b/test-java/app/zoftwhere/mutable/scope/ThrowingConsumerScopeTest.java
similarity index 56%
rename from test-java/app/zoftwhere/function/scope/ThrowingConsumerScopeTest.java
rename to test-java/app/zoftwhere/mutable/scope/ThrowingConsumerScopeTest.java
index 2ea9ef4..87db7a3 100644
--- a/test-java/app/zoftwhere/function/scope/ThrowingConsumerScopeTest.java
+++ b/test-java/app/zoftwhere/mutable/scope/ThrowingConsumerScopeTest.java
@@ -1,10 +1,10 @@
-package app.zoftwhere.function.scope;
+package app.zoftwhere.mutable.scope;
-import app.zoftwhere.function.ThrowingConsumer0;
-import app.zoftwhere.function.ThrowingConsumer1;
-import app.zoftwhere.function.ThrowingConsumer2;
-import app.zoftwhere.function.ThrowingConsumer3;
-import app.zoftwhere.function.ThrowingConsumer4;
+import app.zoftwhere.mutable.function.ThrowingConsumer0;
+import app.zoftwhere.mutable.function.ThrowingConsumer1;
+import app.zoftwhere.mutable.function.ThrowingConsumer2;
+import app.zoftwhere.mutable.function.ThrowingConsumer3;
+import app.zoftwhere.mutable.function.ThrowingConsumer4;
import org.junit.jupiter.api.Test;
class ThrowingConsumerScopeTest {
@@ -12,24 +12,39 @@ class ThrowingConsumerScopeTest {
@Test
void simpleInterfaceTest() {
final ThrowingConsumer0 throw0 = ThrowingConsumerScopeTest::accept;
- try { throw0.accept(); }
- catch (Throwable ignore) {}
+ try {
+ throw0.accept();
+ }
+ catch (Throwable ignore) {
+ }
final ThrowingConsumer1 throw1 = ThrowingConsumerScopeTest::accept;
- try { throw1.accept("s1"); }
- catch (Throwable ignore) {}
+ try {
+ throw1.accept("s1");
+ }
+ catch (Throwable ignore) {
+ }
final ThrowingConsumer2 throw2 = ThrowingConsumerScopeTest::accept;
- try { throw2.accept("s1", "s2"); }
- catch (Throwable ignore) {}
+ try {
+ throw2.accept("s1", "s2");
+ }
+ catch (Throwable ignore) {
+ }
final ThrowingConsumer3 throw3 = ThrowingConsumerScopeTest::accept;
- try { throw3.accept("s1", "s2", "s3"); }
- catch (Throwable ignore) {}
+ try {
+ throw3.accept("s1", "s2", "s3");
+ }
+ catch (Throwable ignore) {
+ }
final ThrowingConsumer4 throw4 = ThrowingConsumerScopeTest::accept;
- try { throw4.accept("s1", "s2", "s3", "s4"); }
- catch (Throwable ignore) {}
+ try {
+ throw4.accept("s1", "s2", "s3", "s4");
+ }
+ catch (Throwable ignore) {
+ }
}
private static void accept() throws Throwable {
@@ -51,4 +66,5 @@ private static void accept(String s1, String s2, String s3) throws Throwable {
private static void accept(String s1, String s2, String s3, String s4) throws Throwable {
throw new Throwable();
}
-}
\ No newline at end of file
+
+}
diff --git a/test-java/app/zoftwhere/mutable/scope/ThrowingFunctionScopeTest.java b/test-java/app/zoftwhere/mutable/scope/ThrowingFunctionScopeTest.java
new file mode 100644
index 0000000..b204c76
--- /dev/null
+++ b/test-java/app/zoftwhere/mutable/scope/ThrowingFunctionScopeTest.java
@@ -0,0 +1,55 @@
+package app.zoftwhere.mutable.scope;
+
+import app.zoftwhere.mutable.function.ThrowingFunction0;
+import app.zoftwhere.mutable.function.ThrowingFunction1;
+import app.zoftwhere.mutable.function.ThrowingFunction2;
+import app.zoftwhere.mutable.function.ThrowingFunction3;
+import app.zoftwhere.mutable.function.ThrowingFunction4;
+import org.junit.jupiter.api.Test;
+
+class ThrowingFunctionScopeTest {
+
+ @Test
+ void testScope() {
+ final ThrowingFunction0 tf0 //
+ = () -> { throw new Throwable(); };
+ try {
+ tf0.accept();
+ }
+ catch (Throwable ignored) {
+ }
+
+ final ThrowingFunction1 tf1 //
+ = (t1) -> { throw new Throwable(); };
+ try {
+ tf1.accept("s1");
+ }
+ catch (Throwable ignored) {
+ }
+
+ final ThrowingFunction2 tf2 //
+ = (t1, t2) -> { throw new Throwable(); };
+ try {
+ tf2.accept("s1", "s2");
+ }
+ catch (Throwable ignored) {
+ }
+
+ final ThrowingFunction3 tf3 //
+ = (t1, t2, t3) -> { throw new Throwable(); };
+ try {
+ tf3.accept("s1", "s2", "s3");
+ }
+ catch (Throwable ignored) {
+ }
+
+ final ThrowingFunction4 tf4 //
+ = (t1, t2, t3, t4) -> { throw new Throwable(); };
+ try {
+ tf4.accept("s1", "s2", "s3", "s4");
+ }
+ catch (Throwable ignored) {
+ }
+ }
+
+}
diff --git a/test-java/example/MutableValueExample.java b/test-java/example/MutableValueExample.java
index b0907d1..713912d 100644
--- a/test-java/example/MutableValueExample.java
+++ b/test-java/example/MutableValueExample.java
@@ -4,7 +4,7 @@
import java.util.Map;
import java.util.function.Supplier;
-import app.zoftwhere.mutable.MutableValue;
+import app.zoftwhere.mutable.collection.MutableValue;
/**
* When you need a final field in your lambda, but you need the value to change later on, using a MutableValue instance
diff --git a/test-java/example/OverlayListExample.java b/test-java/example/OverlayListExample.java
index 1d21459..efd0741 100644
--- a/test-java/example/OverlayListExample.java
+++ b/test-java/example/OverlayListExample.java
@@ -4,7 +4,7 @@
import java.util.Collections;
import java.util.List;
-import app.zoftwhere.mutable.OverlayList;
+import app.zoftwhere.mutable.collection.OverlayList;
public class OverlayListExample {
diff --git a/test-java/example/TransformerExample.java b/test-java/example/TransformerExample.java
index c125283..9ba3aa2 100644
--- a/test-java/example/TransformerExample.java
+++ b/test-java/example/TransformerExample.java
@@ -2,13 +2,13 @@
import java.util.Random;
-import app.zoftwhere.function.Consumer0;
-import app.zoftwhere.function.Consumer1;
-import app.zoftwhere.function.Consumer2;
-import app.zoftwhere.mutable.MutableTransformer0;
-import app.zoftwhere.mutable.MutableTransformer1;
-import app.zoftwhere.mutable.MutableTransformer2;
-import app.zoftwhere.mutable.MutableValue;
+import app.zoftwhere.mutable.collection.MutableTransformer0;
+import app.zoftwhere.mutable.collection.MutableTransformer1;
+import app.zoftwhere.mutable.collection.MutableTransformer2;
+import app.zoftwhere.mutable.collection.MutableValue;
+import app.zoftwhere.mutable.function.Consumer0;
+import app.zoftwhere.mutable.function.Consumer1;
+import app.zoftwhere.mutable.function.Consumer2;
public class TransformerExample {