com.redfin.fuzzy.cases.NullableCase Maven / Gradle / Ivy
package com.redfin.fuzzy.cases;
import com.redfin.fuzzy.Case;
import com.redfin.fuzzy.FuzzyPreconditions;
import com.redfin.fuzzy.Subcase;
import java.util.HashSet;
import java.util.Set;
public class NullableCase implements Case {
private final Case delegateCase;
public NullableCase(Case delegateCase) {
this.delegateCase = FuzzyPreconditions.checkNotNull(delegateCase);
}
@Override
public Set> getSubcases() {
Set> subcases = new HashSet<>();
subcases.addAll(delegateCase.getSubcases());
subcases.add(r -> null);
return subcases;
}
}