static void addToWarsByContext(Entity entity, String url, String targetName) {
   targetName = FILENAME_TO_WEB_CONTEXT_MAPPER.convertDeploymentTargetNameToContext(targetName);
   // TODO a better way to do atomic updates, see comment above
   synchronized (entity) {
     Map<String, String> newWarsMap = MutableMap.copyOf(entity.getConfig(WARS_BY_CONTEXT));
     newWarsMap.put(targetName, url);
     ((EntityInternal) entity).setConfig(WARS_BY_CONTEXT, newWarsMap);
   }
 }
 static boolean removeFromWarsByContext(Entity entity, String targetName) {
   targetName = FILENAME_TO_WEB_CONTEXT_MAPPER.convertDeploymentTargetNameToContext(targetName);
   // TODO a better way to do atomic updates, see comment above
   synchronized (entity) {
     Map<String, String> newWarsMap = MutableMap.copyOf(entity.getConfig(WARS_BY_CONTEXT));
     String url = newWarsMap.remove(targetName);
     if (url == null) {
       return false;
     }
     ((EntityInternal) entity).setConfig(WARS_BY_CONTEXT, newWarsMap);
     return true;
   }
 }