JeffGrigg icon

NumberOfBottlesOfBeerOnTheWallTest

JeffGrigg | PRO | 02/18/20 01:29:30 AM UTC | 0 ⭐ | 11103 👁️ | Never ⏰ | []
Java 5 |

0 B

|

None

|

0 👍

/

0 👎

import junit.framework.TestCase;
 
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
 
public class NumberOfBottlesOfBeerOnTheWallTest extends TestCase {
 
    private static final String NL = System.lineSeparator();
 
    public void testZeroBottlesOfBeerOnTheWall() {
        final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(0));
 
        assertEquals(
                "No bottles of beer" + " on the wall. "
                        + "No bottles of beer. "
                        + "There are no more to pass around. "
                        + "No bottles of beer" + " on the wall." + NL,
                actualOutput);
    }
 
    public void testOneBottleOfBeerOnTheWall() {
        final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(1));
 
        assertEquals(
                "1 bottle of beer on the wall. "
                        + "1 bottle of beer. "
                        + "Take it down and pass it around. "
                        + "No bottles of beer" + " on the wall." + NL
                        //
                        + "No bottles of beer" + " on the wall. "
                        + "No bottles of beer. "
                        + "There are no more to pass around. "
                        + "No bottles of beer" + " on the wall." + NL,
                actualOutput);
    }
 
    public void testTwoBottleOfBeerOnTheWall() {
        final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(2));
 
        assertEquals(
                "2 bottles of beer" + " on the wall. "
                        + "2 bottles of beer. "
                        + "Take one down and pass it around. "
                        + "1 bottle of beer on the wall." + NL
                        //
                        + "1 bottle of beer on the wall. "
                        + "1 bottle of beer. "
                        + "Take it down and pass it around. "
                        + "No bottles of beer" + " on the wall." + NL
                        //
                        + "No bottles of beer" + " on the wall. "
                        + "No bottles of beer. "
                        + "There are no more to pass around. "
                        + "No bottles of beer" + " on the wall." + NL,
                actualOutput);
    }
 
    public void testThreeBottleOfBeerOnTheWall() {
        final String actualOutput = captureStandardOutput(() -> NumberOfBottlesOfBeerOnTheWall.singNumberOfBottlesOfBeerOnTheWall(3));
 
        assertEquals(
                "3 bottles of beer on the wall. "
                        + "3 bottles of beer. "
                        + "Take one down and pass it around. "
                        + "2 bottles of beer on the wall." + NL
                        //
                        + "2 bottles of beer" + " on the wall. "
                        + "2 bottles of beer. "
                        + "Take one down and pass it around. "
                        + "1 bottle of beer on the wall." + NL
                        //
                        + "1 bottle of beer on the wall. "
                        + "1 bottle of beer. "
                        + "Take it down and pass it around. "
                        + "No bottles of beer" + " on the wall." + NL
                        //
                        + "No bottles of beer" + " on the wall. "
                        + "No bottles of beer. "
                        + "There are no more to pass around. "
                        + "No bottles of beer" + " on the wall." + NL,
                actualOutput);
    }
 
    private String captureStandardOutput(final Runnable callback) {
        final PrintStream oldSystemOut = System.out;
        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        final PrintStream printStream = new PrintStream(byteArrayOutputStream);
        System.setOut(printStream);
        try {
            callback.run();
        } finally {
            System.setOut(oldSystemOut);
            printStream.close();
        }
 
        return byteArrayOutputStream.toString();
    }
 
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  • Xorfidar icon
    03/29/26 09:55:41 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎