### Question:
DBSCAN { public DBSCAN(double eps, int minPts, Distance<? super T> distance) { Validate.isTrue(eps > 0, "eps must be greater zero"); Validate.isTrue(minPts > 0, "minPts must be greater zero"); Validate.notNull(distance, "distance must not be null"); this.eps = eps; this.minPts = minPts; this.distance = distance; } DBSCAN(double eps, int minPts, Distance<? super T> distance); Set<Set<T>> cluster(Iterable<? extends T> data); @Override String toString();  }### Answer:
@Test public void testDBSCAN() { DBSCAN<Point> dbscan = new DBSCAN<Point>(1.5, 3, new EuclideanDistance()); Set<Point> points = new HashSet<>(); points.add(new Point(1, 1)); points.add(new Point(2, 1)); points.add(new Point(2, 2)); points.add(new Point(4, 3)); points.add(new Point(5, 3)); points.add(new Point(4, 4)); points.add(new Point(1, 5)); Set<Set<Point>> clusters = dbscan.cluster(points); assertEquals(3, clusters.size()); }