junit-servers-core/src/main/java/com/github/mjeanroy/junit/servers/commons/UrlUtils.java
public static String concatenatePath(String path, String endpoint) {
		String firstSegment = ensureAbsolutePath(path);
		if (endpoint == null || endpoint.isEmpty()) {
			return firstSegment;
		}

		StringBuilder sb = new StringBuilder(firstSegment);
		if (path.charAt(path.length() - 1) != PATH_SEPARATOR) {
			sb.append(PATH_SEPARATOR);
		}

		if (endpoint.charAt(0) == PATH_SEPARATOR) {
			sb.append(endpoint.substring(1));
		}
		else {
			sb.append(endpoint);
		}

		return sb.toString();
	}
public static String concatenatePath(String path, String endpoint) {
		String firstSegment = ensureAbsolutePath(path);
		if (endpoint == null || endpoint.isEmpty()) {
			return firstSegment;
		}

		StringBuilder sb = new StringBuilder(firstSegment);
		if (path.charAt(path.length() - 1) != PATH_SEPARATOR) {
			sb.append(PATH_SEPARATOR);
		}

		if (endpoint.charAt(0) == PATH_SEPARATOR) {
			sb.append(endpoint.substring(1));
		}
		else {
			sb.append(endpoint);
		}

		return sb.toString();
	}
public static String concatenatePath ( String path , String endpoint ) { String firstSegment = ensureAbsolutePath ( path ) ; if ( endpoint == null || endpoint . isEmpty ( ) ) { return firstSegment ; } StringBuilder sb = new StringBuilder ( firstSegment ) ; if ( path . charAt ( path . length ( ) - 1 ) != PATH_SEPARATOR ) { sb . append ( PATH_SEPARATOR ) ; } if ( endpoint . charAt ( 0 ) == PATH_SEPARATOR ) { sb . append ( endpoint . substring ( 1 ) ) ; } else { sb . append ( endpoint ) ; } return sb . toString ( ) ; }
Concatenate two path value.

@param path Path prefix.
@param endpoint Path suffix.
@return Final path.
Concatenate two path value .