// 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 testJettyServerRulePutMethod() throws Exception {
        jettyServer.setHandler(new SimpleJettyHandler() {
            @Override
            protected void onPut() throws IOException {
                final BufferedReader reader = new BufferedReader(new InputStreamReader(request().getInputStream()));
                final PrintWriter out = getResponseWriter();
                out.println(reader.readLine());
            }
        });
        final HttpURLConnection connection = jettyServer.put("/");
        final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()));
        out.write("Hello 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 testJettyServerRuleDeleteMethod() 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/jetty/JettyServerRuleTest.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 testJettyServerRulePutMethod() throws Exception {
        jettyServer.setHandler(new SimpleJettyHandler() {
            @Override
            protected void onPut() throws IOException {
                final BufferedReader reader = new BufferedReader(new InputStreamReader(request().getInputStream()));
                final PrintWriter out = getResponseWriter();
                out.println(reader.readLine());
            }
        });
        final HttpURLConnection connection = jettyServer.put("/");
        final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()));
        out.write("Hello 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 testJettyServerRuleDeleteMethod() throws Exception {
        final SimpleReference<Boolean> deleteIssued = SimpleReference.to(FALSE);