public static List<String> getProperties(Object bean) throws RemoteException
  {
    List<String> result = new ArrayList<String>();
    if (bean == null)
      return result;
    
    if (bean instanceof GenericObject)
    {
      GenericObject o = (GenericObject) bean;
      result.addAll(Arrays.asList(o.getAttributeNames()));
      return result;
    }
    
    Method[] methods = bean.getClass().getMethods();
    if (methods == null || methods.length == 0)
      return result;
    
    for (Method m:methods)
    {
      String name = m.getName();
      if (name.startsWith("get") && name.length() > 3)
        result.add(toProperty(name));
    }
    return result;
  }