ReflectionStringConverter(Class<T> cls,Method toString){
  if (toString.getParameterTypes().length != 0) {
    throw new IllegalStateException("ToString method must have no parameters");
  }
  if (toString.getReturnType() != String.class) {
    throw new IllegalStateException("ToString method must return a String");
  }
  this.cls=cls;
  this.toString=toString;
}

ReflectionStringConverter ( Class < T > cls , Method toString ) { if ( toString . getParameterTypes ( ) . length != 0 ) { throw new IllegalStateException ( "ToString method must have no parameters" ) ; } if ( toString . getReturnType ( ) != String . class ) { throw new IllegalStateException ( "ToString method must return a String" ) ; } this . cls = cls ; this . toString = toString ; }
creates an instance using two methods .
