@Test public void testCopy() { final Context source = new Context(new Id(CONTEXT_ID), new Description(DESCRIPTION), BuiltInType.BOOLEAN.asQName()); final Context target = source.copy(); assertNotNull(target); assertNotEquals(CONTEXT_ID, target.getId().getValue()); assertEquals(DESCRIPTION, target.getDescription().getValue()); assertEquals(BuiltInType.BOOLEAN.asQName(), target.getTypeRef()); }
@Override public Context copy() { final Context clonedContext = new Context(); clonedContext.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedContext.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedContext.componentWidths = new ArrayList<>(componentWidths); clonedContext.contextEntry = Optional.ofNullable(contextEntry) .map(contextEntryList -> contextEntryList.stream().map(ContextEntry::copy).collect(Collectors.toList())) .orElse(null); return clonedContext; }
Context extends Expression { @Override public Context copy() { final Context clonedContext = new Context(); clonedContext.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedContext.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedContext.componentWidths = new ArrayList<>(componentWidths); clonedContext.contextEntry = Optional.ofNullable(contextEntry) .map(contextEntryList -> contextEntryList.stream().map(ContextEntry::copy).collect(Collectors.toList())) .orElse(null); return clonedContext; } }
Context extends Expression { @Override public Context copy() { final Context clonedContext = new Context(); clonedContext.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedContext.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedContext.componentWidths = new ArrayList<>(componentWidths); clonedContext.contextEntry = Optional.ofNullable(contextEntry) .map(contextEntryList -> contextEntryList.stream().map(ContextEntry::copy).collect(Collectors.toList())) .orElse(null); return clonedContext; } Context();  Context(final Id id,
                   final Description description,
                   final QName typeRef); }
Context extends Expression { @Override public Context copy() { final Context clonedContext = new Context(); clonedContext.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedContext.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedContext.componentWidths = new ArrayList<>(componentWidths); clonedContext.contextEntry = Optional.ofNullable(contextEntry) .map(contextEntryList -> contextEntryList.stream().map(ContextEntry::copy).collect(Collectors.toList())) .orElse(null); return clonedContext; } Context();  Context(final Id id,
                   final Description description,
                   final QName typeRef); @Override Context copy(); List<ContextEntry> getContextEntry(); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode(); }
Context extends Expression { @Override public Context copy() { final Context clonedContext = new Context(); clonedContext.description = Optional.ofNullable(description).map(Description::copy).orElse(null); clonedContext.typeRef = Optional.ofNullable(typeRef).map(QName::copy).orElse(null); clonedContext.componentWidths = new ArrayList<>(componentWidths); clonedContext.contextEntry = Optional.ofNullable(contextEntry) .map(contextEntryList -> contextEntryList.stream().map(ContextEntry::copy).collect(Collectors.toList())) .orElse(null); return clonedContext; } Context();  Context(final Id id,
                   final Description description,
                   final QName typeRef); @Override Context copy(); List<ContextEntry> getContextEntry(); @Override List<HasTypeRef> getHasTypeRefs(); @Override int getRequiredComponentWidthCount(); @Override boolean equals(final Object o); @Override int hashCode();  }