Buggy code:
public class PerforceHistoryParserTest { public PerforceHistoryParserTest ( ) { } @ BeforeClass public static void setUpClass ( ) throws Exception { } @ AfterClass public static void tearDownClass ( ) throws Exception { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void parseChanges ( ) throws Exception { } @ Test public void parseFileLog ( ) throws Exception { String output = "////Path//To//Folder//In//Workspace//Filename\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "\n" + "...<seq2seq4repair_space>#4<seq2seq4repair_space>change<seq2seq4repair_space>1234<seq2seq4repair_space>edit<seq2seq4repair_space>on<seq2seq4repair_space>2008//08//19<seq2seq4repair_space>11:30:00<seq2seq4repair_space>by<seq2seq4repair_space>User@UserWorkspaceName<seq2seq4repair_space>(text)\n" ) + "\n" ) + "<seq2seq4repair_space>Comment<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>change<seq2seq4repair_space>number<seq2seq4repair_space>4\n" ) + "\n" ) + "...<seq2seq4repair_space>#3<seq2seq4repair_space>change<seq2seq4repair_space>5678<seq2seq4repair_space>edit<seq2seq4repair_space>on<seq2seq4repair_space>2008//08//19<seq2seq4repair_space>18:25:38<seq2seq4repair_space>by<seq2seq4repair_space>ADMIN@UserWorkspaceName<seq2seq4repair_space>(text)\n" ) + "\n" ) + "<seq2seq4repair_space>Comment<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>change\n" ) + "\n" ) + "...<seq2seq4repair_space>#2<seq2seq4repair_space>change<seq2seq4repair_space>8765<seq2seq4repair_space>edit<seq2seq4repair_space>on<seq2seq4repair_space>2008//08//01<seq2seq4repair_space>01:00:01<seq2seq4repair_space>by<seq2seq4repair_space>ADMIN@UserWorkspaceName<seq2seq4repair_space>(text)\n" ) + "\n" ) + "<seq2seq4repair_space>Comment<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>change\n" ) + "\n" ) + "...<seq2seq4repair_space>#1<seq2seq4repair_space>change<seq2seq4repair_space>1<seq2seq4repair_space>add<seq2seq4repair_space>on<seq2seq4repair_space>2008//07//30<seq2seq4repair_space>17:45:33<seq2seq4repair_space>by<seq2seq4repair_space>ADMIN@UserWorkspaceName<seq2seq4repair_space>(text)\n" ) + "\n" ) + "<seq2seq4repair_space>Comment<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>change" ) ; History result = PerforceHistoryParser . parseFileLog ( new StringReader ( output ) ) ; assertNotNull ( result ) ; assertEquals ( 4 , result . getHistoryEntries ( ) . size ( ) ) ; HistoryEntry e1 = result . getHistoryEntries ( ) . get ( 0 ) ; <START_BUG> assertEquals ( "4" , e1 . getRevision ( ) ) ; <END_BUG> assertEquals ( "User" , e1 . getAuthor ( ) ) ; assertEquals ( 0 , e1 . getFiles ( ) . size ( ) ) ; assertTrue ( e1 . getMessage ( ) . contains ( "number<seq2seq4repair_space>4" ) ) ; HistoryEntry e2 = result . getHistoryEntries ( ) . get ( 1 ) ; assertNotNull ( e2 ) ; HistoryEntry e3 = result . getHistoryEntries ( ) . get ( 2 ) ; assertNotNull ( e3 ) ; HistoryEntry e4 = result . getHistoryEntries ( ) . get ( 3 ) ; assertEquals ( "1" , e4 . getRevision ( ) ) ; PerforceHistoryParserTest . assertDate ( e1 , 2008 , Calendar . AUGUST , 19 ) ; PerforceHistoryParserTest . assertDate ( e2 , 2008 , Calendar . AUGUST , 19 ) ; PerforceHistoryParserTest . assertDate ( e3 , 2008 , Calendar . AUGUST , 1 ) ; PerforceHistoryParserTest . assertDate ( e4 , 2008 , Calendar . JULY , 30 ) ; } private static void assertDate ( HistoryEntry entry , int year , int month , int day ) { } }

Fix:
assertEquals ( "1234" , e1 . getRevision ( ) ) ;