### Question:
KubernetesApiNames { public static boolean matches(String className, Class<?> candidateClass) { if (!candidateClass.getName().startsWith("io.kubernetes.client")) { return false; } String[] parts = className.split("\\."); if (parts.length < 2) { return false; } String last = parts[parts.length - 1]; String nextToLast = parts[parts.length - 2]; String simpleName = candidateClass.getSimpleName(); return matches(simpleName, nextToLast, last); }  static boolean matches(String className, Class<?> candidateClass);  }### Answer:
@Test public void matchTopLevelClass() { assertThat(KubernetesApiNames.matches("io.k8s.api.core.v1.EnvVar", V1EnvVar.class), is(true)); }
@Test public void matchNestedClass() { assertThat(KubernetesApiNames.matches("io.k8s.api.core.v1.EnvVar", V1.EnvVar.class), is(true)); }
@Test public void dontMatchOthers() { assertThat(KubernetesApiNames.matches("abc", V1EnvVarSource.class), is(false)); assertThat( KubernetesApiNames.matches("io.k8s.api.core.v1.EnvVar", V1EnvVarSource.class), is(false)); }