This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.mockwebserver.Dispatcher; | |
import com.google.mockwebserver.MockResponse; | |
import com.google.mockwebserver.MockWebServer; | |
import com.google.mockwebserver.RecordedRequest; | |
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
public class Redirector { | |
public static void main(String[] args) throws IOException { | |
MockWebServer server = new MockWebServer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*bin/mkdir /tmp/rip 2> /dev/null | |
javac -d /tmp/rip $0 | |
java -cp /tmp/rip Rip "$@" | |
exit | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.*; | |
import java.util.regex.Matcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package p1; | |
public class A { | |
void foo() { | |
System.out.println("A.foo"); | |
} | |
public void aFoo() { | |
foo(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mockitousage.packageprotected; | |
import org.junit.Test; | |
import static org.mockito.Mockito.spy; | |
import static org.mockito.Mockito.verify; | |
import static org.mockito.Mockito.verifyNoMoreInteractions; | |
import org.mockitoutil.ClassLoaderBuilder; | |
import org.mockitoutil.TestBase; | |
public class MockingAndClassLoadersTest extends TestBase { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import junit.framework.TestCase; | |
public class PutDuringRemoveEldestEntryTest extends TestCase { | |
public void test() { | |
Map<String, String> map = new LinkedHashMap<String, String>(4) { | |
@Override protected boolean removeEldestEntry(Map.Entry<String, String> eldest) { | |
if (size() == 4) { | |
super.put("a", "a"); // This will trigger doubleCapacity(). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2013 Square, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.squareup.okhttp.HttpResponseCache; | |
import com.squareup.okhttp.OkHttpClient; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.UUID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.android.dex; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.Map; | |
import java.util.TreeMap; | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class Summary { | |
public static void main(String[] args) throws IOException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by the protocol buffer compiler. DO NOT EDIT! | |
// source: person.proto | |
package com.squareup.wire.protos.person; | |
public final class PersonProtos { | |
private PersonProtos() {} | |
public static void registerAllExtensions( | |
com.google.protobuf.ExtensionRegistry registry) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by Wire protocol buffer compiler, do not edit. | |
// Source file: /Users/jwilson/Square/wire/wire-runtime/src/test/proto/person.proto | |
package com.squareup.wire.protos.person; | |
import com.squareup.wire.Message; | |
import com.squareup.wire.ProtoEnum; | |
import com.squareup.wire.ProtoField; | |
import java.util.Collections; | |
import java.util.List; |
OlderNewer