### Question:
OmKeyInfo extends WithObjectID { public OmKeyInfo copyObject() { OmKeyInfo.Builder builder = new OmKeyInfo.Builder() .setVolumeName(volumeName) .setBucketName(bucketName) .setKeyName(keyName) .setCreationTime(creationTime) .setModificationTime(modificationTime) .setDataSize(dataSize) .setReplicationType(type) .setReplicationFactor(factor) .setFileEncryptionInfo(encInfo) .setObjectID(objectID).setUpdateID(updateID); keyLocationVersions.forEach(keyLocationVersion -> builder.addOmKeyLocationInfoGroup( new OmKeyLocationInfoGroup(keyLocationVersion.getVersion(), keyLocationVersion.getLocationList()))); acls.forEach(acl -> builder.addAcl(new OzoneAcl(acl.getType(), acl.getName(), (BitSet) acl.getAclBitSet().clone(), acl.getAclScope()))); if (metadata != null) { metadata.forEach((k, v) -> builder.addMetadata(k, v)); } return builder.build(); } @SuppressWarnings("parameternumber")  OmKeyInfo(String volumeName, String bucketName, String keyName,
      List<OmKeyLocationInfoGroup> versions, long dataSize,
      long creationTime, long modificationTime,
      HddsProtos.ReplicationType type,
      HddsProtos.ReplicationFactor factor,
      Map<String, String> metadata,
      FileEncryptionInfo encInfo, List<OzoneAcl> acls,
      long objectID, long updateID); String getVolumeName(); String getBucketName(); HddsProtos.ReplicationType getType(); HddsProtos.ReplicationFactor getFactor(); String getKeyName(); void setKeyName(String keyName); long getDataSize(); void setDataSize(long size); synchronized OmKeyLocationInfoGroup getLatestVersionLocations(); List<OmKeyLocationInfoGroup> getKeyLocationVersions(); void updateModifcationTime(); void updateLocationInfoList(List<OmKeyLocationInfo> locationInfoList); synchronized void appendNewBlocks(
      List<OmKeyLocationInfo> newLocationList, boolean updateTime); synchronized long addNewVersion(
      List<OmKeyLocationInfo> newLocationList, boolean updateTime); long getCreationTime(); long getModificationTime(); void setModificationTime(long modificationTime); FileEncryptionInfo getFileEncryptionInfo(); List<OzoneAcl> getAcls(); boolean addAcl(OzoneAcl acl); boolean removeAcl(OzoneAcl acl); boolean setAcls(List<OzoneAcl> newAcls); KeyInfo getProtobuf(); KeyInfo getProtobuf(boolean ignorePipeline); static OmKeyInfo getFromProtobuf(KeyInfo keyInfo); @Override String getObjectInfo(); @Override boolean equals(Object o); @Override int hashCode(); OmKeyInfo copyObject(); void clearFileEncryptionInfo();  }### Answer:
@Test public void testCopyObject() { OmKeyInfo key = new Builder() .setKeyName("key1") .setBucketName("bucket") .setVolumeName("vol1") .setCreationTime(Time.now()) .setModificationTime(Time.now()) .setDataSize(100L) .setReplicationFactor(ReplicationFactor.THREE) .setReplicationType(ReplicationType.RATIS) .addMetadata("key1", "value1") .addMetadata("key2", "value2") .setOmKeyLocationInfos( Collections.singletonList(createOmKeyLocationInfoGroup())) .build(); OmKeyInfo cloneKey = key.copyObject(); Assert.assertNotEquals(key, cloneKey); key.setAcls(Arrays.asList(new OzoneAcl( IAccessAuthorizer.ACLIdentityType.USER, "user1", IAccessAuthorizer.ACLType.WRITE, ACCESS))); Assert.assertNotEquals(key, cloneKey); Assert.assertNotEquals(key.getAcls(), cloneKey.getAcls()); cloneKey = key.copyObject(); Assert.assertEquals(key.getAcls(), cloneKey.getAcls()); }