class 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);
  }

}