### Question:
GeogigFeatureSource extends ContentFeatureSource { public NodeRef getTypeRef() { GeoGigDataStore dataStore = getDataStore(); org.opengis.feature.type.Name name = getName(); Transaction transaction = getTransaction(); return dataStore.findTypeRef(name, transaction); } GeogigFeatureSource(ContentEntry entry); @Override GeoGigDataStore getDataStore(); @Override ContentState getState(); @Override org.opengis.feature.type.Name getName(); @VisibleForTesting @Override boolean handleVisitor(Query query, FeatureVisitor visitor); NodeRef getTypeRef(); static final Hints.Key WALK_INFO_KEY; static final ThreadLocal<WalkInfo> WALK_INFO; }### Answer:
public @Test void handleMinVisitorMaterializedAttribute() { NodeRef typeRef = pointsSource.delegate.getTypeRef(); createIndex(typeRef, Collections.singletonList("ip")); testVisitor(new MinVisitor("ip"), Integer.valueOf(1000)); }
public @Test void handleUniqueVisitorMaterializedAttribute() { NodeRef typeRef = pointsSource.delegate.getTypeRef(); createIndex(typeRef, Collections.singletonList("ip")); testVisitor(new UniqueVisitor("ip"), Sets.newHashSet(1000, 2000, 3000)); }
public @Test void handleMaxVisitorMaterializedAttribute() { NodeRef typeRef = pointsSource.delegate.getTypeRef(); createIndex(typeRef, Collections.singletonList("ip")); testVisitor(new MaxVisitor("ip"), Integer.valueOf(3000)); }
public @Test void handleNearestVisitorMaterializedAttribute() { NodeRef typeRef = pointsSource.delegate.getTypeRef(); createIndex(typeRef, Collections.singletonList("ip")); final int valueToMatch = 2050; Integer expectedResult = Integer.valueOf(2000); testVisitor(new NearestVisitor(ff.property("ip"), valueToMatch), expectedResult); }