private static boolean stubClassExists(Class<?> remoteClass){
  if (!withoutStubs.containsKey(remoteClass)) {
    try {
      Class.forName(remoteClass.getName() + "_Stub",false,remoteClass.getClassLoader());
      return true;
    }
 catch (    ClassNotFoundException cnfe) {
      withoutStubs.put(remoteClass,null);
    }
  }
  return false;
}

private static boolean stubClassExists ( Class < ? > remoteClass ) { if ( ! withoutStubs . containsKey ( remoteClass ) ) { try { Class . forName ( remoteClass . getName ( ) + "_Stub" , false , remoteClass . getClassLoader ( ) ) ; return true ; } catch ( ClassNotFoundException cnfe ) { withoutStubs . put ( remoteClass , null ) ; } } return false ; }
returns true if a stub class for the given impl class can be loaded , otherwise returns false .
