### Question:
S3RepositoryFactory implements RepositoryFactory { @Override public Repository newInstance(String name, String url) { URI uri = URI.create(url); String scheme = uri.getScheme(); if (!"s3".equalsIgnoreCase(scheme)) { throw new IllegalArgumentException("Invalid s3 url: " + url); } String bucket = uri.getHost(); String prefix = uri.getPath(); if (!prefix.isEmpty()) { prefix = prefix.substring(1); } boolean isArchive = FilenameUtils.isArchiveFile(prefix); if (!isArchive && !prefix.isEmpty() && !prefix.endsWith("/")) { prefix += '/'; } String modelName = null; String artifactId = null; String query = uri.getQuery(); if (query != null) { Matcher matcher = NAME_PATTERN.matcher(query); if (matcher.find()) { modelName = matcher.group(1); } matcher = ARTIFACT_PATTERN.matcher(query); if (matcher.find()) { artifactId = matcher.group(1); } } if (artifactId == null) { if (prefix.isEmpty()) { artifactId = bucket; } else { Path path = Paths.get(prefix); Path fileName = path.getFileName(); if (fileName == null) { throw new AssertionError("This should never happen."); } artifactId = fileName.toString(); } } if (isArchive) { artifactId = FilenameUtils.getNamePart(artifactId); } if (modelName == null) { modelName = artifactId; } return new S3Repository(client, name, bucket, prefix, artifactId, modelName); } S3RepositoryFactory();  S3RepositoryFactory(S3Client client); @Override Repository newInstance(String name, String url); @Override Set<String> getSupportedScheme();  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void testUnsupportedProtocol() { S3RepositoryFactory factory = new S3RepositoryFactory(); factory.newInstance("s3", "https: }