Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micw/c5efd8d0fe514bd3afa8 to your computer and use it in GitHub Desktop.
Save micw/c5efd8d0fe514bd3afa8 to your computer and use it in GitHub Desktop.
Did you know that PI * LEET / 100 = 42?
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import org.junit.Test;
public class TestTheAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything
{
final int LEET = 1337;
final double PI = Math.PI;
final int THE_ANSWER = 42;
@Test
public void testTheAnswerToTheUltimateQuestionOfLifeTheUniverseAndEverything()
{
assertThat(THE_ANSWER, is(42));
assertThat(LEET, is(1337));
assertThat(PI, is(closeTo(3.1416d, 0.001d)));
assertThat((int) (PI * LEET / 100d), is(THE_ANSWER));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment