code: protected static void closeContext(InitialContext initialContext) {
          if (initialContext != null) {
              try {
                  initialContext.close();
              } catch (NamingException e) {
                  LOGGER.debug("Can't close InitialContext", e);
              }
          }
      }
docs: Close InitialContext
  
  @param initialContext initial context