### Question:
Pop3Store extends RemoteStore { public static String createUri(ServerSettings server) { String userEnc = encodeUtf8(server.username); String passwordEnc = (server.password != null) ? encodeUtf8(server.password) : ""; String clientCertificateAliasEnc = (server.clientCertificateAlias != null) ? encodeUtf8(server.clientCertificateAlias) : ""; String scheme; switch (server.connectionSecurity) { case SSL_TLS_REQUIRED: scheme = "pop3+ssl+"; break; case STARTTLS_REQUIRED: scheme = "pop3+tls+"; break; default: case NONE: scheme = "pop3"; break; } AuthType authType = server.authenticationType; String userInfo; if (AuthType.EXTERNAL == authType) { userInfo = authType.name() + ":" + userEnc + ":" + clientCertificateAliasEnc; } else { userInfo = authType.name() + ":" + userEnc + ":" + passwordEnc; } try { return new URI(scheme, userInfo, server.host, server.port, null, null, null).toString(); } catch (URISyntaxException e) { throw new IllegalArgumentException("Can't create Pop3Store URI", e); } } Pop3Store(StoreConfig storeConfig, TrustedSocketFactory socketFactory); static ServerSettings decodeUri(String uri); static String createUri(ServerSettings server); @Override @NonNull Pop3Folder getFolder(String name); @Override @NonNull List <Pop3Folder> getFolders(boolean forceListAll); @NonNull @Override List<? extends Folder> getSubFolders(String parentFolderId, boolean forceListAll); @Override void checkSettings(); @Override boolean isSeenFlagSupported(); Pop3Connection createConnection();  }### Answer:
@Test public void createUri_withSSLTLS_required_shouldProduceSSLUri() { ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.PLAIN, "user", "password", null); String uri = Pop3Store.createUri(settings); assertEquals(uri, "pop3+ssl+: }
@Test public void createUri_withSTARTTLSRequired_shouldProduceTLSUri() { ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.STARTTLS_REQUIRED, AuthType.PLAIN, "user", "password", null); String uri = Pop3Store.createUri(settings); assertEquals(uri, "pop3+tls+: }
@Test public void createUri_withNONE_shouldProducePop3Uri() { ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.NONE, AuthType.PLAIN, "user", "password", null); String uri = Pop3Store.createUri(settings); assertEquals(uri, "pop3: }
@Test public void createUri_withPLAIN_shouldProducePlainAuthUri() { ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.NONE, AuthType.PLAIN, "user", "password", null); String uri = Pop3Store.createUri(settings); assertEquals(uri, "pop3: }
@Test public void createUri_withEXTERNAL_shouldProduceExternalAuthUri() { ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.NONE, AuthType.EXTERNAL, "user", "password", "clientCert"); String uri = Pop3Store.createUri(settings); assertEquals(uri, "pop3: }
@Test public void createUri_withCRAMMD5_shouldProduceCRAMMD5AuthUri() { ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.NONE, AuthType.CRAM_MD5, "user", "password", "clientCert"); String uri = Pop3Store.createUri(settings); assertEquals(uri, "pop3: }