### Question:
QueryId { public static QueryId fromExternalString( String queryIdText ) throws InvalidArgumentsException { try { if ( queryIdText.startsWith( QUERY_ID_PREFIX ) ) { return new QueryId( Long.parseLong( queryIdText.substring( QUERY_ID_PREFIX.length() ) ) ); } } catch ( NumberFormatException e ) { throw new InvalidArgumentsException( "Could not parse query id (expected format: query-1234)", e ); } throw new InvalidArgumentsException( "Could not parse query id (expected format: query-1234)" ); } private  QueryId( long kernelQueryId ); static QueryId ofInternalId( long queryId ); static QueryId fromExternalString( String queryIdText ); long kernelQueryId(); @Override boolean equals( Object o ); @Override int hashCode(); @Override String toString(); static final String QUERY_ID_PREFIX; }### Answer:
@Test public void doesNotParseNegativeQueryIds() throws InvalidArgumentsException { thrown.expect( InvalidArgumentsException.class ); fromExternalString( "query--12" ); }
@Test public void doesNotParseRandomText() throws InvalidArgumentsException { thrown.expect( InvalidArgumentsException.class ); fromExternalString( "blarglbarf" ); }
@Test public void doesNotParseTrailingRandomText() throws InvalidArgumentsException { thrown.expect( InvalidArgumentsException.class ); fromExternalString( "query-12 " ); }
@Test public void doesNotParseEmptyText() throws InvalidArgumentsException { thrown.expect( InvalidArgumentsException.class ); fromExternalString( "" ); }