@Test public void should() { assertThat(ResourceMethodMeta.combine(null, null)).isEqualTo("/"); assertThat(ResourceMethodMeta.combine("", null)).isEqualTo("/"); assertThat(ResourceMethodMeta.combine(null, "")).isEqualTo("/"); assertThat(ResourceMethodMeta.combine("", "")).isEqualTo("/"); assertThat(ResourceMethodMeta.combine("/abc", "/xyz")).isEqualTo("/abc/xyz"); assertThat(ResourceMethodMeta.combine("/abc", "xyz")).isEqualTo("/abc/xyz"); assertThat(ResourceMethodMeta.combine("abc", "/xyz")).isEqualTo("/abc/xyz"); assertThat(ResourceMethodMeta.combine("abc", "xyz")).isEqualTo("/abc/xyz"); assertThat(ResourceMethodMeta.combine("abc", null)).isEqualTo("/abc"); assertThat(ResourceMethodMeta.combine(null, "xyz")).isEqualTo("/xyz"); assertThat(ResourceMethodMeta.combine("abc", "")).isEqualTo("/abc"); assertThat(ResourceMethodMeta.combine("", "xyz")).isEqualTo("/xyz"); assertThat(ResourceMethodMeta.combine("/abc", "")).isEqualTo("/abc"); assertThat(ResourceMethodMeta.combine("", "/xyz")).isEqualTo("/xyz"); }
static String combine(@Nullable String classPath, @Nullable String methodPath) { if (classPath == null || classPath.isEmpty() || classPath.equals("/")) { return normalize(methodPath); } if (methodPath == null || methodPath.isEmpty() || methodPath.equals("/")) { return normalize(classPath); } return normalize(classPath) + normalize(methodPath); }
ResourceMethodMeta { static String combine(@Nullable String classPath, @Nullable String methodPath) { if (classPath == null || classPath.isEmpty() || classPath.equals("/")) { return normalize(methodPath); } if (methodPath == null || methodPath.isEmpty() || methodPath.equals("/")) { return normalize(classPath); } return normalize(classPath) + normalize(methodPath); } }
ResourceMethodMeta { static String combine(@Nullable String classPath, @Nullable String methodPath) { if (classPath == null || classPath.isEmpty() || classPath.equals("/")) { return normalize(methodPath); } if (methodPath == null || methodPath.isEmpty() || methodPath.equals("/")) { return normalize(classPath); } return normalize(classPath) + normalize(methodPath); } ResourceMethodMeta(Method method); }
ResourceMethodMeta { static String combine(@Nullable String classPath, @Nullable String methodPath) { if (classPath == null || classPath.isEmpty() || classPath.equals("/")) { return normalize(methodPath); } if (methodPath == null || methodPath.isEmpty() || methodPath.equals("/")) { return normalize(classPath); } return normalize(classPath) + normalize(methodPath); } ResourceMethodMeta(Method method);  }
ResourceMethodMeta { static String combine(@Nullable String classPath, @Nullable String methodPath) { if (classPath == null || classPath.isEmpty() || classPath.equals("/")) { return normalize(methodPath); } if (methodPath == null || methodPath.isEmpty() || methodPath.equals("/")) { return normalize(classPath); } return normalize(classPath) + normalize(methodPath); } ResourceMethodMeta(Method method);   }