Currently available tools for semantic clone detection have serious type limitations related to objects, in particular related to instantiation and comparison. The trend in the recent research has focused on improving the performance rather than removing these constraints. This paper proposes a test-based approach for semantic clone detection in Java which overcomes these problems. The test-based approach consists in running two methods with the same input and comparing their outputs. For object instantiation, the approach uses EvoSuite, an automatic JUnit test generator, to create the tests with correct instantiations of all the needed classes, which are then modified to make them suitable for semantic clone detection. The output comparison uses the DeepHash function to obtain numerical values for objects, considering the values of each instance variable. The approach was evaluated with SemanticCloneBench. The results show that the proposed approach performs very well in terms of precision, achieving 94.4%, which is about 8% higher than the reported precision of SLACC, a recent semantic clone detector. Furthermore, out of 228 methods used for the evaluation, the approach was not able to perform the detection for only ten methods.