public static Comparator<ImageData> getComparator(CompareType type) {
if (!cache.containsKey(type)) {
switch (type) {
case WIDTH:
cache.put(CompareType.WIDTH, new WidthComparator());
break;
case HEIGHT:
cache.put(CompareType.HEIGHT, new HeightComparator());
break;