code: private static String depluralize(String s) {
          if (s.endsWith("ies")) {
              return s.substring(0, s.length() - 3) + 'y';
          }
          if (s.endsWith("s")) {
              return s.substring(0, s.length() - 1);
          }
          return s;
      }
docs: Convert a string like "abcs" to "abc".