We don't need about matchDuplicate and foundDuplicate since they do almost the same thing.  foundDuplicate is the same as matchDuplicate != null.  

Also matchDuplicate doesn't trim the input to make sure that "Sample" == "    Sample   "