Buggy code:
public void testAddedSpriteVisibleOnLongList ( ) { } public void testOrientation ( ) throws NameNotFoundException { } public void testRenameSpriteContextMenu ( ) { } public void testDeleteSpriteContextMenu ( ) { } public void testChooseNoOnDeleteQuestion ( ) { } public void testMainMenuButton ( ) { } public void testCheckMaxTextLines ( ) { } public void testNewSpriteDialog ( ) { } public void testNewSpriteDialogErrorMessages ( ) { } public void testRenameSpriteDialog ( ) { } public void testHeadlinesInList ( ) { } public void testClickOnHeadlines ( ) { } public void testSpriteListDetails ( ) { } public void testBottomBarAndContextMenuOnActionModes ( ) { } public void testDeleteActionModeCheckingAndTitle ( ) { } public void testDeleteActionModeIfNothingSelected ( ) { } public void testDeleteActionModeIfSelectedAndPressingBack ( ) { } public void testDeleteActionMode ( ) { } public void testDeleteSelectAll ( ) { } public void testItemClick ( ) { } public void testConfirmDeleteObjectDialogTitleChange ( ) { } public void testChooseNoOnDeleteQuestionInActionMode ( ) { } public void testDeleteMultipleSprites ( ) { } public void testLongClickCancelDeleteAndCopy ( ) { } public void testRenameActionModeChecking ( ) { } public void testRenameActionModeIfNothingSelected ( ) { } public void testRenameActionModeIfSelectedAndPressingBack ( ) { } public void testRenameActionMode ( ) { } public void testOverFlowMenuSettings ( ) { } public void testBottombarElementsVisibilty ( ) { } private void addSprite ( String spriteName ) { } private void checkVisibilityOfViews ( View detailsView , boolean visible ) { } private void checkIfCheckboxesAreCorrectlyChecked ( boolean firstCheckboxExpectedChecked , boolean secondCheckboxExpectedChecked ) { } private void checkIfNumberOfSpritesIsEqual ( int expectedNumber ) { } private int getCurrentNumberOfSprites ( ) { } private void clickOnContextMenuItem ( String spriteName , String itemName ) { } private void checkIfContextMenuAppears ( boolean contextMenuShouldAppear , boolean isDeleteActionMode ) { } private void enterTextAndCloseDialog ( String text ) { } private int checkNumberOfElements ( Sprite firstSprite , Sprite copiedSprite ) { } private void checkSpecialBricks ( Sprite firstSprite , Sprite copiedSprite ) { assertEquals ( "Message<seq2seq4repair_space>of<seq2seq4repair_space>BroadcastReceiver<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>right!" , ( ( org . catrobat . catroid . content . BroadcastScript ) ( firstSprite . getScript ( 1 ) ) ) . getBroadcastMessage ( ) , ( ( org . catrobat . catroid . content . BroadcastScript ) ( copiedSprite . getScript ( 1 ) ) ) . getBroadcastMessage ( ) ) ; ArrayList < Brick > brickListFirstSprite = firstSprite . getScript ( 0 ) . getBrickList ( ) ; ArrayList < Brick > brickListCopiedSprite = copiedSprite . getScript ( 0 ) . getBrickList ( ) ; LoopBeginBrick firstLoopBrick = ( ( LoopBeginBrick ) ( brickListFirstSprite . get ( 32 ) ) ) ; LoopEndBrick firstEndBrick = ( ( LoopEndBrick ) ( brickListFirstSprite . get ( 33 ) ) ) ; LoopBeginBrick copiedLoopBrick = ( ( LoopBeginBrick ) ( brickListCopiedSprite . get ( 32 ) ) ) ; LoopEndBrick copiedEndBrick = ( ( LoopEndBrick ) ( brickListCopiedSprite . get ( 33 ) ) ) ; assertNotSame ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstLoopBrick , copiedLoopBrick ) ; assertNotSame ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstEndBrick , copiedEndBrick ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstLoopBrick , firstEndBrick . getLoopBeginBrick ( ) ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstEndBrick , firstLoopBrick . getLoopEndBrick ( ) ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedLoopBrick , copiedEndBrick . getLoopBeginBrick ( ) ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedEndBrick , copiedLoopBrick . getLoopEndBrick ( ) ) ; firstLoopBrick = ( ( LoopBeginBrick ) ( brickListFirstSprite . get ( 34 ) ) ) ; firstEndBrick = ( ( LoopEndBrick ) ( brickListFirstSprite . get ( 35 ) ) ) ; copiedLoopBrick = ( ( LoopBeginBrick ) ( brickListCopiedSprite . get ( 34 ) ) ) ; copiedEndBrick = ( ( LoopEndBrick ) ( brickListCopiedSprite . get ( 35 ) ) ) ; Formula firstCondition = ( ( FormulaBrick ) ( firstLoopBrick ) ) . getFormulaWithBrickField ( TIMES_TO_REPEAT ) ; <START_BUG> Formula copiedCondition = ( ( FormulaBrick ) ( firstLoopBrick ) ) . getFormulaWithBrickField ( TIMES_TO_REPEAT ) ; <END_BUG> assertNotSame ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstLoopBrick , copiedLoopBrick ) ; assertNotSame ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstEndBrick , copiedEndBrick ) ; assertNotSame ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstCondition , copiedCondition ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstLoopBrick , firstEndBrick . getLoopBeginBrick ( ) ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstEndBrick , firstLoopBrick . getLoopEndBrick ( ) ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedLoopBrick , copiedEndBrick . getLoopBeginBrick ( ) ) ; assertEquals ( "Loop<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedEndBrick , copiedLoopBrick . getLoopEndBrick ( ) ) ; IfLogicBeginBrick firstIfBeginBrick = ( ( IfLogicBeginBrick ) ( brickListFirstSprite . get ( 37 ) ) ) ; IfLogicElseBrick firstIfElseBrick = ( ( IfLogicElseBrick ) ( brickListFirstSprite . get ( 39 ) ) ) ; IfLogicEndBrick firstIfEndBrick = ( ( IfLogicEndBrick ) ( brickListFirstSprite . get ( 41 ) ) ) ; IfLogicBeginBrick copiedIfBeginBrick = ( ( IfLogicBeginBrick ) ( brickListCopiedSprite . get ( 37 ) ) ) ; IfLogicElseBrick copiedIfElseBrick = ( ( IfLogicElseBrick ) ( brickListCopiedSprite . get ( 39 ) ) ) ; IfLogicEndBrick copiedIfEndBrick = ( ( IfLogicEndBrick ) ( brickListCopiedSprite . get ( 41 ) ) ) ; firstCondition = firstIfBeginBrick . getFormulaWithBrickField ( IF_CONDITION ) ; copiedCondition = copiedIfBeginBrick . getFormulaWithBrickField ( IF_CONDITION ) ; assertNotSame ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfBeginBrick , copiedIfBeginBrick ) ; assertNotSame ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfElseBrick , copiedIfElseBrick ) ; assertNotSame ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfEndBrick , copiedIfEndBrick ) ; assertNotSame ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstCondition , copiedCondition ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfBeginBrick , firstIfElseBrick . getIfBeginBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfBeginBrick , firstIfEndBrick . getIfBeginBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfElseBrick , firstIfBeginBrick . getIfElseBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfElseBrick , firstIfEndBrick . getIfElseBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfEndBrick , firstIfBeginBrick . getIfEndBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , firstIfEndBrick , firstIfElseBrick . getIfEndBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedIfBeginBrick , copiedIfElseBrick . getIfBeginBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedIfBeginBrick , copiedIfEndBrick . getIfBeginBrick ( ) ) ; assertEquals ( "If<seq2seq4repair_space>Brick<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>copied<seq2seq4repair_space>right!" , copiedIfElseBrick , copiedIfBeginBrick . getIfElseBrick ( ) ) ;

Fix:
Formula copiedCondition = ( ( FormulaBrick ) ( copiedLoopBrick ) ) . getFormulaWithBrickField ( TIMES_TO_REPEAT ) ;