### Question:
ObjectEndpoint extends EndpointBase { @VisibleForTesting public static Pair<String, String> parseSourceHeader(String copyHeader) throws OS3Exception { String header = copyHeader; if (header.startsWith("/")) { header = copyHeader.substring(1); } int pos = header.indexOf('/'); if (pos == -1) { OS3Exception ex = S3ErrorTable.newError(S3ErrorTable .INVALID_ARGUMENT, header); ex.setErrorMessage("Copy Source must mention the source bucket and " + "key: sourcebucket/sourcekey"); throw ex; } return Pair.of(header.substring(0, pos), header.substring(pos + 1)); } ObjectEndpoint(); @PostConstruct void init(); @PUT Response put(
      @PathParam("bucket") String bucketName,
      @PathParam("path") String keyPath,
      @HeaderParam("Content-Length") long length,
      @QueryParam("partNumber")  int partNumber,
      @QueryParam("uploadId") @DefaultValue("") String uploadID,
      InputStream body); @GET Response get(
      @PathParam("bucket") String bucketName,
      @PathParam("path") String keyPath,
      @QueryParam("uploadId") String uploadId,
      @QueryParam("max-parts") @DefaultValue("1000") int maxParts,
      @QueryParam("part-number-marker") String partNumberMarker,
      InputStream body); @HEAD Response head(
      @PathParam("bucket") String bucketName,
      @PathParam("path") String keyPath); @DELETE @SuppressWarnings("emptyblock") Response delete(
      @PathParam("bucket") String bucketName,
      @PathParam("path") String keyPath,
      @QueryParam("uploadId") @DefaultValue("") String uploadId); @POST @Produces(MediaType.APPLICATION_XML) @Consumes(HeaderPreprocessor.MULTIPART_UPLOAD_MARKER) Response initializeMultipartUpload(
      @PathParam("bucket") String bucket,
      @PathParam("path") String key
  ); @POST @Produces(MediaType.APPLICATION_XML) Response completeMultipartUpload(@PathParam("bucket") String bucket,
      @PathParam("path") String key,
      @QueryParam("uploadId") @DefaultValue("") String uploadID,
      CompleteMultipartUploadRequest multipartUploadRequest); @VisibleForTesting void setHeaders(HttpHeaders headers); @VisibleForTesting static Pair<String, String> parseSourceHeader(String copyHeader);  }### Answer:
@Test public void parseSourceHeader() throws OS3Exception { Pair<String, String> bucketKey = ObjectEndpoint.parseSourceHeader("bucket1/key1"); Assert.assertEquals("bucket1", bucketKey.getLeft()); Assert.assertEquals("key1", bucketKey.getRight()); }
@Test public void parseSourceHeaderWithPrefix() throws OS3Exception { Pair<String, String> bucketKey = ObjectEndpoint.parseSourceHeader("/bucket1/key1"); Assert.assertEquals("bucket1", bucketKey.getLeft()); Assert.assertEquals("key1", bucketKey.getRight()); }