class Bbox implements Serializable {

	public static Pair<Pair<Double,Double>,Pair<Double,Double>> getPoints(Bbox source) {
		if (source != null && source.getBbox() != null) {
			Pattern pattern = Pattern.compile("BOX\\(\\s*([-\\d\\.]+)\\s+([-\\d\\.]+)\\s*,\\s*([-\\d\\.]+)\\s+([-\\d\\.]+)\\s*\\)");
			Matcher matcher = pattern.matcher(source.getBbox());
			if (matcher.matches()) {
				double minX = Double.parseDouble(matcher.group(1));
				double minY = Double.parseDouble(matcher.group(2));
				double maxX = Double.parseDouble(matcher.group(3));
				double maxY = Double.parseDouble(matcher.group(4));
				return new ImmutablePair<>(new ImmutablePair<>(minX,minY), new ImmutablePair<>(maxX,maxY));
			}
		}

		return null;
	}

}