class Addresses {

   public static String getId(@Nullable String addressOrId) {
      if(addressOrId == null) {
         return "";
      }
      int indexOf = addressOrId.lastIndexOf(":");
      if(indexOf < 0) {
         return addressOrId;
      }
      else if(indexOf == addressOrId.length() - 1) {
         return "";
      }
      return addressOrId.substring(indexOf + 1);
   }

}