code: protected static <T extends Manifest> T removeFromEnvironment(Environment environment, Class<T> type) {
          String identifier = type.getName();
          Object manifest = environment.get(identifier);
          if (manifest != null) {
              environment.set(identifier, null);
          }
          return type.cast(manifest);
      }
docs: Removes and returns the Manifest from the Environment.
  
  @param environment the Environment
  @param type the type of Manifest
  @return the Manifest