class JsonToImageTranslator {

  @VisibleForTesting
  static ImmutableSet<AbsoluteUnixPath> volumeMapToSet(@Nullable Map<String, Map<?, ?>> volumeMap)
      throws BadContainerConfigurationFormatException {
    if (volumeMap == null) {
      return ImmutableSet.of();
    }

    ImmutableSet.Builder<AbsoluteUnixPath> volumeList = ImmutableSet.builder();
    for (String volume : volumeMap.keySet()) {
      try {
        volumeList.add(AbsoluteUnixPath.get(volume));
      } catch (IllegalArgumentException exception) {
        throw new BadContainerConfigurationFormatException("Invalid volume path: " + volume);
      }
    }

    return volumeList.build();
  }

  private  JsonToImageTranslator();

}