### Question:
GoPathContext { String concat(String parentPath, String childPath) { if (parentPath.isEmpty() || parentPath.charAt(parentPath.length() - 1) == fileSeparator) { return parentPath + childPath; } return parentPath + fileSeparator + childPath; } GoPathContext(char fileSeparator, String pathSeparator, @Nullable String goPath); String resolve(String filePath); static final GoPathContext DEFAULT; }### Answer:
@Test public void concat_linux() { GoPathContext context = new GoPathContext('/', ":", "/home/paul/go"); assertThat(context.concat("/home", "paul")).isEqualTo("/home/paul"); assertThat(context.concat("/home/", "paul")).isEqualTo("/home/paul"); assertThat(context.concat("/", "paul")).isEqualTo("/paul"); assertThat(context.concat("", "paul")).isEqualTo("paul"); }
@Test public void concat_windows() { GoPathContext context = new GoPathContext('\\', ";", "C:\\Users\\paul\\go"); assertThat(context.concat("C:\\Users", "paul")).isEqualTo("C:\\Users\\paul"); assertThat(context.concat("C:\\Users\\", "paul")).isEqualTo("C:\\Users\\paul"); assertThat(context.concat("C:\\", "paul")).isEqualTo("C:\\paul"); assertThat(context.concat("", "paul")).isEqualTo("paul"); }