@Test void maxInd_sharedColumn_contained() { final List<InclusionDependency> toCheck = asList( ind("wx", "yz"), ind("w", "y")); assertThat(util.getMax(toCheck)).containsOnly(ind("wx", "yz")); }
public List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify) { final List<InclusionDependency> ind = new LinkedList<>(toMinify); ind.sort(Comparator.comparing(this::degreeOf).reversed()); final List<InclusionDependency> maxInd = new ArrayList<>(); while (!ind.isEmpty()) { final InclusionDependency current = ind.remove(0); ind.removeAll(containedOf(current, ind)); maxInd.add(current); } return maxInd; }
InclusionDependencyUtil { public List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify) { final List<InclusionDependency> ind = new LinkedList<>(toMinify); ind.sort(Comparator.comparing(this::degreeOf).reversed()); final List<InclusionDependency> maxInd = new ArrayList<>(); while (!ind.isEmpty()) { final InclusionDependency current = ind.remove(0); ind.removeAll(containedOf(current, ind)); maxInd.add(current); } return maxInd; } }
InclusionDependencyUtil { public List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify) { final List<InclusionDependency> ind = new LinkedList<>(toMinify); ind.sort(Comparator.comparing(this::degreeOf).reversed()); final List<InclusionDependency> maxInd = new ArrayList<>(); while (!ind.isEmpty()) { final InclusionDependency current = ind.remove(0); ind.removeAll(containedOf(current, ind)); maxInd.add(current); } return maxInd; }  }
InclusionDependencyUtil { public List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify) { final List<InclusionDependency> ind = new LinkedList<>(toMinify); ind.sort(Comparator.comparing(this::degreeOf).reversed()); final List<InclusionDependency> maxInd = new ArrayList<>(); while (!ind.isEmpty()) { final InclusionDependency current = ind.remove(0); ind.removeAll(containedOf(current, ind)); maxInd.add(current); } return maxInd; }  static ImmutableSet<InclusionDependency> sortIndAttributes(Collection<InclusionDependency> inds); List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify); }
InclusionDependencyUtil { public List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify) { final List<InclusionDependency> ind = new LinkedList<>(toMinify); ind.sort(Comparator.comparing(this::degreeOf).reversed()); final List<InclusionDependency> maxInd = new ArrayList<>(); while (!ind.isEmpty()) { final InclusionDependency current = ind.remove(0); ind.removeAll(containedOf(current, ind)); maxInd.add(current); } return maxInd; }  static ImmutableSet<InclusionDependency> sortIndAttributes(Collection<InclusionDependency> inds); List<InclusionDependency> getMax(final Collection<InclusionDependency> toMinify);  }