public void testClear() {
    matcher.add(Arrays.asList(new Mat()));

    matcher.clear();

    assertTrue(matcher.empty());
  }
  public void testCloneBoolean() {
    matcher.add(Arrays.asList(new Mat()));

    DescriptorMatcher cloned = matcher.clone(true);

    assertNotNull(cloned);
    assertTrue(cloned.empty());
  }
  public void testMatchMatListOfDMatch() {
    Mat train = getTrainDescriptors();
    Mat query = getQueryDescriptors();
    MatOfDMatch matches = new MatOfDMatch();
    matcher.add(Arrays.asList(train));

    matcher.match(query, matches);

    assertArrayDMatchEquals(truth, matches.toArray(), EPS);
  }
  public void testGetTrainDescriptors() {
    Mat train = new Mat(1, 1, CvType.CV_8U, new Scalar(123));
    Mat truth = train.clone();
    matcher.add(Arrays.asList(train));

    List<Mat> descriptors = matcher.getTrainDescriptors();

    assertEquals(1, descriptors.size());
    assertMatEqual(truth, descriptors.get(0));
  }
  public void testMatchMatListOfDMatchListOfMat() {
    Mat train = getTrainDescriptors();
    Mat query = getQueryDescriptors();
    Mat mask = getMaskImg();
    MatOfDMatch matches = new MatOfDMatch();
    matcher.add(Arrays.asList(train));

    matcher.match(query, matches, Arrays.asList(mask));

    assertListDMatchEquals(Arrays.asList(truth[0], truth[1]), matches.toList(), EPS);
  }
 public void testAdd() {
   matcher.add(Arrays.asList(new Mat()));
   assertFalse(matcher.empty());
 }