// Path: src/test/java/junit/rules/util/SimpleReference.java
// public class SimpleReference<T> {
// 
//     private T value;
// 
//     /**
//      * @return the object referenced
//      */
//     public final T get() {
//         return value;
//     }
// 
//     /**
//      * @param obj
//      *        the new object to reference
//      */
//     public final void set(final T obj) {
//         this.value = obj;
//     }
// 
//     /**
//      * @param <T>
//      *        a type
//      * @param obj
//      *        the object we want to reference
//      * @return a SimpleReference to the object
//      */
//     public static <T> SimpleReference<T> to(final T obj) {
//         return new SimpleReference<T>();
//     }
// }


import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static java.net.HttpURLConnection.HTTP_OK;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import junit.rules.util.SimpleReference;
import org.junit.Rule;
import org.junit.Test;
     * @throws Exception
     *         should never happen
     */
    @Test
    public void testHttpServerRulePutMethod() throws Exception {
        httpServer.addHandler("/", new SimpleHttpHandler() {
            @Override
            protected void onPut() throws IOException {
                final BufferedReader reader = new BufferedReader(new InputStreamReader(getRequestBody()));
                getResponseWriter().write("Hello " + reader.readLine());
                sendResponse(HTTP_OK);
            }
        });
        final HttpURLConnection connection = httpServer.put("/");
        final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()));
        out.write("Again");
        out.flush();
        final BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
        assertEquals("Hello Again", in.readLine());
        assertEquals(HTTP_OK, connection.getResponseCode());
    }

    /**
     * Test HTTP DELETE
     *
     * @throws Exception
     *         should never happen
     */
    @Test
    public void testHttpServerRuleDeleteMethod() throws Exception {
// Path: src/test/java/junit/rules/util/SimpleReference.java
// public class SimpleReference<T> {
// 
//     private T value;
// 
//     /**
//      * @return the object referenced
//      */
//     public final T get() {
//         return value;
//     }
// 
//     /**
//      * @param obj
//      *        the new object to reference
//      */
//     public final void set(final T obj) {
//         this.value = obj;
//     }
// 
//     /**
//      * @param <T>
//      *        a type
//      * @param obj
//      *        the object we want to reference
//      * @return a SimpleReference to the object
//      */
//     public static <T> SimpleReference<T> to(final T obj) {
//         return new SimpleReference<T>();
//     }
// }


// Path: src/test/java/junit/rules/httpserver/HttpServerRuleTest.java
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static java.net.HttpURLConnection.HTTP_OK;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import junit.rules.util.SimpleReference;
import org.junit.Rule;
import org.junit.Test;

     * @throws Exception
     *         should never happen
     */
    @Test
    public void testHttpServerRulePutMethod() throws Exception {
        httpServer.addHandler("/", new SimpleHttpHandler() {
            @Override
            protected void onPut() throws IOException {
                final BufferedReader reader = new BufferedReader(new InputStreamReader(getRequestBody()));
                getResponseWriter().write("Hello " + reader.readLine());
                sendResponse(HTTP_OK);
            }
        });
        final HttpURLConnection connection = httpServer.put("/");
        final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()));
        out.write("Again");
        out.flush();
        final BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
        assertEquals("Hello Again", in.readLine());
        assertEquals(HTTP_OK, connection.getResponseCode());
    }

    /**
     * Test HTTP DELETE
     *
     * @throws Exception
     *         should never happen
     */
    @Test
    public void testHttpServerRuleDeleteMethod() throws Exception {
        final SimpleReference<Boolean> deleteIssued = SimpleReference.to(FALSE);