diff --git a/src/main/java/envoy/data/Contact.java b/src/main/java/envoy/data/Contact.java
index 3e830f1..96b703e 100644
--- a/src/main/java/envoy/data/Contact.java
+++ b/src/main/java/envoy/data/Contact.java
@@ -15,7 +15,7 @@ import java.io.Serializable;
*/
public abstract class Contact implements Serializable {
- private long id;
+ private final long id;
private String name;
private static final long serialVersionUID = 0L;
diff --git a/src/main/java/envoy/data/Group.java b/src/main/java/envoy/data/Group.java
index 7de0f20..cab866f 100644
--- a/src/main/java/envoy/data/Group.java
+++ b/src/main/java/envoy/data/Group.java
@@ -2,6 +2,7 @@ package envoy.data;
import java.util.ArrayList;
import java.util.List;
+import java.util.StringJoiner;
/**
* Project: envoy-common
@@ -57,12 +58,10 @@ public class Group extends Contact {
*/
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("Group[id=" + getId() + ",name=" + getName() + ",memberIDs=[");
- memberIDs.forEach(id -> { sb.append(id); sb.append(", "); });
- // deleting the final ", "
- sb.delete(sb.length() - 2, sb.length());
- sb.append("]]");
- return sb.toString();
+ var joiner = new StringJoiner(",", "Group[id=", "]");
+ joiner.add("id=" + getId());
+ joiner.add("name=" + getName());
+ joiner.add("memberIDs=" + getMemberIDs());
+ return joiner.toString();
}
}