public static ICountable getAsICountable(Object var, Expression expression) throws CoreException {
if (var instanceof ICountable) {
return (ICountable)var;
} else {
IAdapterManager manager= Platform.getAdapterManager();
ICountable result= (ICountable)manager.getAdapter(var, ICountable.class);
if (result != null)
return result;
if (manager.queryAdapter(var, ICountable.class.getName()) == IAdapterManager.NOT_LOADED)
return null;