Skip to content

Instantly share code, notes, and snippets.

@christopherperry
Last active December 30, 2015 10:19
Show Gist options
  • Save christopherperry/7815316 to your computer and use it in GitHub Desktop.
Save christopherperry/7815316 to your computer and use it in GitHub Desktop.

Revisions

  1. christopherperry revised this gist Dec 5, 2013. 1 changed file with 17 additions and 10 deletions.
    27 changes: 17 additions & 10 deletions HappyDebuggingSuckers.java
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,17 @@
    @Test
    public void happyDebuggingSuckers() throws SecurityException, NoSuchFieldException, IllegalAccessException {
    Field value = Boolean.class.getDeclaredField("value");
    value.setAccessible(true);
    Boolean manipulatedBoolean = true;
    value.setBoolean(manipulatedBoolean, false);

    Boolean setToTrue = true;
    assertThat(setToTrue).isFalse();
    }
    @Test
    public void happyDebuggingSuckers() throws SecurityException, NoSuchFieldException, IllegalAccessException {
    Field value = Boolean.class.getDeclaredField("value");
    value.setAccessible(true);

    Boolean trueBool = true;
    Boolean falseBool = false;

    value.setBoolean(trueBool, false);
    value.setBoolean(falseBool, true);

    Boolean setToTrue = true;
    assertThat(setToTrue).isFalse();

    Boolean setToFalse = false;
    assertThat(setToFalse).isTrue();
    }
  2. christopherperry created this gist Dec 5, 2013.
    10 changes: 10 additions & 0 deletions HappyDebuggingSuckers.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    @Test
    public void happyDebuggingSuckers() throws SecurityException, NoSuchFieldException, IllegalAccessException {
    Field value = Boolean.class.getDeclaredField("value");
    value.setAccessible(true);
    Boolean manipulatedBoolean = true;
    value.setBoolean(manipulatedBoolean, false);

    Boolean setToTrue = true;
    assertThat(setToTrue).isFalse();
    }