### Question:
ThriftClientAddress implements Comparable<ThriftClientAddress> { public static ThriftClientAddress parse(String address){ Objects.requireNonNull(address, "address"); String[] params = address.split(","); String[] urlSplit = params[0].split(":", 2); String host = urlSplit[0]; if (host.contains("=") || host.trim().isEmpty()) { throw new ThriftConnectionException("Unable to parse address " + address); } int port; if (urlSplit.length == 2) { try { port = Integer.parseInt(urlSplit[1]); } catch (NumberFormatException e) { throw new ThriftConnectionException("Unable to parse address " + address, e); } } else { port = DEFAULT_SERVER_THRIFT_PORT; } Map<String, String> paramsMap; if (params.length > 1) { paramsMap = new LinkedHashMap<>(params.length); for (int i = 1; i < params.length; i++) { String[] nameValue = params[i].split("=", 2); if (nameValue.length == 1) { paramsMap.put(nameValue[0], ""); } else { paramsMap.put(nameValue[0], nameValue[1]); } } } else { paramsMap = Collections.emptyMap(); } return new ThriftClientAddress(host, port, paramsMap); } ThriftClientAddress(String host, int port);  ThriftClientAddress(String host, int port, Map<String, String> parameters); String getHost(); int getPort(); Map<String, String> getParameters(); String getDc(); String getClusterName(); Optional<ThriftTraceMode> getTraceMode(); String toShortString(); String toEscapedString(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static ThriftClientAddress parse(String address); static ThriftClientAddress of(ParameterSource source); static Supplier<ThriftClientAddress> supplier(ParameterSource source); static List<ThriftClientAddress> parseList(String servers); @Override int compareTo(ThriftClientAddress o); static final int DEFAULT_SERVER_THRIFT_PORT; static final String DEFAULT_DC_NAME_CLIENT; static final String DEFAULT_DC_NAME_SERVER; static final String DEFAULT_CLUSTER_NAME; static final String DC_PARAMETER; static final String TRACE_TYPE_PARAMETER; static final String CLUSTER_NAME_PARAMETER; @Deprecated
    static final String VERSION_PARAMETER; }### Answer:
@Test(groups = "unit", dataProvider = "parseDataProvider") public void parse(String address, String result) throws Exception { ThriftClientAddress addressParsed = ThriftClientAddress.parse(address); assertEquals(addressParsed.toString(), result); }
@Test(groups = "unit", dataProvider = "parseErrorDataProvider", expectedExceptions = ThriftConnectionException.class) public void parseError(String address) throws Exception { ThriftClientAddress.parse(address); }
@Test(groups = "unit", expectedExceptions = NullPointerException.class) public void parseNPE() throws Exception { ThriftClientAddress.parse(null); }
@Test(groups = "unit", expectedExceptions = ThriftConnectionException.class) public void parseError2() throws Exception { ThriftClientAddress.parse("test.osmp.ru:31d31"); }