PropertyPath implements Comparable<PropertyPath> { public PropertyPath merge(final PropertyPath otherPath) { List<String> mergedParts = new ArrayList<>(this.parts); mergedParts.addAll(otherPath.parts); return new PropertyPath(mergedParts); } @JsonCreator  PropertyPath(@JsonProperty("parts") final List<String> parts); static PropertyPath blank(); static PropertyPath fromPathString(final String propertyPath); static PropertyPath fromParts(final String... parts); static PropertyPath fromParts(final List<String> parts); PropertyPath merge(final PropertyPath otherPath); PropertyPath merge(final String part); @JsonIgnore String getPropertyName(); static Builder builder(); @Override int compareTo(final PropertyPath other); @Override String toString(); @Override boolean equals(final Object o); boolean equalsIgnoreCase(final PropertyPath o); @Override int hashCode();  }
@Test void merge() { PropertyPath propertyPath1 = PropertyPath.fromParts("stroom", "node"); PropertyPath propertyPath2 = PropertyPath.fromParts("name"); Assertions.assertThat(propertyPath1.merge(propertyPath2).toString()).isEqualTo("stroom.node.name"); }