code: public static String getOtherName(String source, String target){
  
          String other;
          if (target.contains(source) && !target.equals(source)) {
  
              int start = target.indexOf(source);
              other = start == 0 ? target.substring(source.length()) : target.substring(0, start);
          }
          else{
              return null;
          }
          if(other.startsWith("_")){
              other = other.replaceFirst("_", " ");
          }
          if(other.endsWith("_")){
              byte[] otherb = other.getBytes();
              otherb[otherb.length - 1] = ' ';
              other = new String(otherb);
          }
          return other.trim();
      }
docs: If a table name is made of two other table names (as is typical for many to many relationships),
  this method retrieves a name of "another" table from a join table name.
  For instance, if a source table is "payer" and the target is "player_game", then the returned value
  will be "game".
  
  @param source known table name. It may or may not exist in the target table name.
  @param target this is a potential "join" table name.
  @return a name of "another" table from a join table name.