@Test public void testCopy() { final org.kie.workbench.common.dmn.api.definition.model.List source = new org.kie.workbench.common.dmn.api.definition.model.List( new Id(LIST_ID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName(), new ArrayList<>() ); final org.kie.workbench.common.dmn.api.definition.model.List target = source.copy(); assertNotNull(target); assertNotEquals(LIST_ID, target.getId()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); assertTrue(target.getExpression().isEmpty()); }
@Override public List copy() { final List clonedList = new List(); clonedList.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedList.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedList.componentWidths = new ArrayList<>(componentWidths); clonedList.expression = expression.stream().map(expressionWrapperMappingFn(clonedList)).collect(Collectors.toList()); return clonedList; }
List extends Expression { @Override public List copy() { final List clonedList = new List(); clonedList.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedList.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedList.componentWidths = new ArrayList<>(componentWidths); clonedList.expression = expression.stream().map(expressionWrapperMappingFn(clonedList)).collect(Collectors.toList()); return clonedList; } }
List extends Expression { @Override public List copy() { final List clonedList = new List(); clonedList.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedList.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedList.componentWidths = new ArrayList<>(componentWidths); clonedList.expression = expression.stream().map(expressionWrapperMappingFn(clonedList)).collect(Collectors.toList()); return clonedList; } List();  List(final Id id,
                final Description description,
                final QName typeRef,
                final java.util.List<HasExpression> expression); }
List extends Expression { @Override public List copy() { final List clonedList = new List(); clonedList.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedList.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedList.componentWidths = new ArrayList<>(componentWidths); clonedList.expression = expression.stream().map(expressionWrapperMappingFn(clonedList)).collect(Collectors.toList()); return clonedList; } List();  List(final Id id,
                final Description description,
                final QName typeRef,
                final java.util.List<HasExpression> expression); @Override List copy(); java.util.List<HasExpression> getExpression(); @Override java.util.List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
List extends Expression { @Override public List copy() { final List clonedList = new List(); clonedList.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedList.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedList.componentWidths = new ArrayList<>(componentWidths); clonedList.expression = expression.stream().map(expressionWrapperMappingFn(clonedList)).collect(Collectors.toList()); return clonedList; } List();  List(final Id id,
                final Description description,
                final QName typeRef,
                final java.util.List<HasExpression> expression); @Override List copy(); java.util.List<HasExpression> getExpression(); @Override java.util.List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }