class Addresses {

   public static String toObjectAddress(String namespace, String id) {
      if(id == null) {
         return toServiceAddress(namespace);
      }
      if(namespace == null) throw new IllegalArgumentException("namespace may not be null");
      String prefix = getPrefixForNamespace(namespace);
      return prefix + namespace + ":" + id;
   }

}