public void startsWith ( String string ) { checkNotNull ( string ) ; if ( actual ( ) == null ) { failWithActual ( "expected a string that starts with" , string ) ; } else if ( ! actual ( ) . startsWith ( string ) ) { failWithActual ( "expected to start with" , string ) ; } }
Fails if the string does not start with the given string .