public void add ( final Object obj ) { final Class < ? > clazz = obj . getClass ( ) ; if ( this . clazzes . contains ( clazz ) ) { throw new IllegalArgumentException ( "Only one class-instance per benchmark allowed" ) ; } else { this . clazzes . add ( clazz ) ; this . objects . add ( obj ) ; } }
Adding a already instantiated objects to benchmark . Per benchmark only one objects of each class is allowed .