Returns a copy of the BioPAX element
(with all the property values are same)

@param <T> biopax type
@param source biopax element to copy
@param newID copy biopax element's absolute URI
@return a copy of the source biopax element
7800
public <T extends BioPAXElement> T copy(T source, String newID) 
	{
		T copy = (T) level.getDefaultFactory().create(
				(Class<T>) source.getModelInterface(), newID);
		this.copy = copy;
		// to avoid unnecessary checks/warnings when existing valid element is being cloned  
		//(e.g., copying BPS.stepProcess values, if there is a Conversion, which was set via stepConversion).
		AbstractPropertyEditor.checkRestrictions.set(false);
		traverser.traverse(source, null);
		AbstractPropertyEditor.checkRestrictions.set(true);//back to default
		return copy;
	}
117905
private Properties copyProperties(Properties source)
    {
        Properties copy = new Properties();

        if (source != null)
        {
            copy.putAll(source);
        }

        return copy;
    }
896215
public static Vector copyOf(Vector source) {
        if (source instanceof DoubleVector)
            return copyOf((DoubleVector) source);
        if (source instanceof IntegerVector)
            return copyOf((IntegerVector) source);

        Vector result = new DenseVector(source.length());
        for (int i = 0; i < source.length(); ++i) 
            result.set(i, source.getValue(i));
        return result;
    }
91019
public static Repository newInstance(String uid)
    {
        Repository repository = new Repository();
        repository.setUid(uid);
        return repository;
    }
429490
public static <T extends Object> T cloneSerializable(T source) {
        ByteArrayOutputStream baos = null;
        ObjectOutputStream oos = null;
        ByteArrayInputStream bais = null;
        ObjectInputStream ois = null;
        try {
            baos = new ByteArrayOutputStream();
            oos = new ObjectOutputStream(baos);
            oos.writeObject(source);

            bais = new ByteArrayInputStream(baos.toByteArray());
            ois = new ObjectInputStream(bais);
            return (T) ois.readObject();
        } catch (IOException e) {
            return null;
        } catch (ClassNotFoundException e) {
            return null;
        } finally {
            closeQuietly(baos, oos, bais, ois);
        }
    }
368729
private static Props copyNext(final Props source) {
    Props priorNodeCopy = null;
    if (source.getParent() != null) {
      priorNodeCopy = copyNext(source.getParent());
    }
    final Props dest = new Props(priorNodeCopy);
    for (final String key : source.localKeySet()) {
      dest.put(key, source.get(key));
    }

    return dest;
  }
914021
public static DataSourceBackendId getInstance(String id) {
        DataSourceBackendId result = cache.get(id);
        if (result == null) {
            id = id.intern();
            result = new DataSourceBackendId(id);
            cache.put(id, result);
        }
        return result;
    }
543695
private MetaHolder createCopy(MetaHolder source, ExecutionType executionType) {
        return MetaHolder.builder()
                .obj(source.getObj())
                .method(source.getMethod())
                .ajcMethod(source.getAjcMethod())
                .fallbackExecutionType(source.getFallbackExecutionType())
                .extendedFallback(source.isExtendedFallback())
                .extendedParentFallback(source.isExtendedParentFallback())
                .executionType(executionType)
                .args(source.getArgs())
                .observable(source.isObservable())
                .observableExecutionMode(source.getObservableExecutionMode())
                .defaultCollapserKey(source.getDefaultCollapserKey())
                .defaultCommandKey(source.getDefaultCommandKey())
                .defaultGroupKey(source.getDefaultGroupKey())
                .defaultThreadPoolKey(source.getDefaultThreadPoolKey())
                .defaultProperties(source.getDefaultProperties().orNull())
                .hystrixCollapser(source.getHystrixCollapser())
                .hystrixCommand(source.getHystrixCommand()).build();
    }
1038522
public void setSourceUrl(String newUrl, int id) {
        PreparedStatement statement = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "UPDATE " + Constants.DB_TABLE_SERVERS +
                    " SET " + Constants.SERVER_REDIRECT_SRC_URL + " = ?" +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            statement.setString(1, newUrl);
            statement.setInt(2, id);
            statement.executeUpdate();
            statement.close();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
516
public static <T> BeanCopier<T> create(Object source, T dest, CopyOptions copyOptions) {
		return create(source, dest, dest.getClass(), copyOptions);
	}
672859
public void copyElement(final String id, final I_CmsSimpleCallback<CmsUUID> callback) {

        CmsRpcAction<CmsUUID> action = new CmsRpcAction<CmsUUID>() {

            @Override
            public void execute() {

                start(200, false);
                getContainerpageService().copyElement(
                    CmsCoreProvider.get().getStructureId(),
                    new CmsUUID(id),
                    getData().getLocale(),
                    this);
            }

            @Override
            protected void onResponse(CmsUUID result) {

                stop(false);
                callback.execute(result);
            }

        };
        action.execute();
    }
508983
public BoxRequestsBookmark.UpdateBookmark getRenameRequest(String id, String newName) {
        BoxRequestsBookmark.UpdateBookmark request = new BoxRequestsBookmark.UpdateBookmark(id, getBookmarkInfoUrl(id), mSession);
        request.setName(newName);
        return request;
    }
493804
void copyIdField(Element readNode) {
        String newId = readNode.getAttribute("data-semantic-id");
        if (!StringUtils.isEmpty(newId)) {
            readNode.setAttribute("id", "p" + newId);
        }
        for (Node child : new NonWhitespaceNodeList(readNode.getChildNodes())) {
            if (child instanceof Element) {
                copyIdField((Element) child);
            }
        }
    }
1122938
public AnnotationTypeElementDoc wrap(AnnotationTypeElementDoc source) {
		if (source == null || source instanceof Proxy<?> || !(source instanceof AnnotationTypeElementDocImpl)) {
			return source;
		}
		return new AnnotationTypeElementDocWrapper((AnnotationTypeElementDocImpl) source);
	}
348805
Configuration copyWithIdentifier(String identifier) {
		return new Configuration(details.builder().identifier(identifier).build(), new HashMap<>(config));
	}
1322418
private String toSource(Node n, SourceMap sourceMap, boolean firstOutput) {
    CodePrinter.Builder builder = new CodePrinter.Builder(n);
    builder.setTypeRegistry(getTypeRegistry());
    builder.setCompilerOptions(options);
    builder.setSourceMap(sourceMap);
    builder.setTagAsTypeSummary(!n.isFromExterns() && options.shouldGenerateTypedExterns());
    builder.setTagAsStrict(firstOutput && options.shouldEmitUseStrict());
    return builder.build();
  }
204450
public static Object duplicateArray(Object source) {

        int size = Array.getLength(source);
        Object newarray =
            Array.newInstance(source.getClass().getComponentType(), size);

        System.arraycopy(source, 0, newarray, 0, size);

        return newarray;
    }