private static String getCurrentLocators(OfflineGfshCommand gfshCommand)
      throws MalformedObjectNameException {
    String delimitedLocators = "";
    try {
      if (gfshCommand.isConnectedAndReady()) {
        final DistributedSystemMXBean dsMBeanProxy = getDistributedSystemMXBean();
        if (dsMBeanProxy != null) {
          final String[] locators = dsMBeanProxy.listLocators();
          if (locators != null && locators.length > 0) {
            final StringBuilder sb = new StringBuilder();
            for (int i = 0; i < locators.length; i++) {
              if (i > 0) {
                sb.append(",");
              }
              sb.append(locators[i]);
            }
            delimitedLocators = sb.toString();
          }
        }
      }
    } catch (IOException e) { // thrown by getDistributedSystemMXBean
      // leave delimitedLocators = ""
      gfshCommand.getGfsh().logWarning("DistributedSystemMXBean is unavailable\n", e);
    }
    return delimitedLocators;
  }
Encapsulates methods used by StartServerCommand and StartLocatorCommand and their associated
tests.

@see StartLocatorCommand
@see StartServerCommand
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/commands/StartMemberUtils.java