// Path: brjs-core/src/main/java/org/bladerunnerjs/api/plugin/base/AbstractPlugin.java
// public abstract class AbstractPlugin implements Plugin {
// 	@Override
// 	public boolean equals(Object otherPlugin) {
// 		return (otherPlugin instanceof VirtualProxyPlugin) ? otherPlugin.equals(this) : (this == otherPlugin);
// 	}
// 	
// 	@Override
// 	public void close() {
// 		// do nothing -- concrete implementations may choose to override this method, but very few will ever need to
// 	}
// 	
// 	@Override
// 	public <P extends Plugin> boolean instanceOf(Class<P> pluginInterface) {
// 		return pluginInterface.isAssignableFrom(getClass());
// 	}
// 	
// 	@SuppressWarnings("unchecked")
// 	@Override
// 	public <P extends Plugin> P castTo(Class<P> pluginInterface) {
// 		return (P) this;
// 	}
// 	
// 	@Override
// 	public Class<?> getPluginClass() {
// 		return getClass();
// 	}
// 	
// }


import static org.junit.Assert.*;
import org.bladerunnerjs.api.BRJS;
import org.bladerunnerjs.api.plugin.Plugin;
import org.bladerunnerjs.api.plugin.base.AbstractPlugin;
import org.bladerunnerjs.plugin.proxy.VirtualProxyPlugin;
import org.junit.Test;
package org.bladerunnerjs.plugin;



public class VirtualProxyPluginTest {
	@Test
	public void instanceOfWorks() {
		Plugin plugin = new VirtualProxyPlugin(new MyTestPlugin());
		
		assertTrue("1", plugin.instanceOf(MyTestPlugin.class));
		assertTrue("2", plugin.instanceOf(TestPlugin.class));
	}
	
	@Test
	public void equalityWorks() {
		Plugin plugin = new MyTestPlugin();
		Plugin proxyPlugin = new VirtualProxyPlugin(plugin);
		
		assertTrue("1", plugin.equals(plugin));
		assertTrue("2", proxyPlugin.equals(proxyPlugin));
		assertTrue("3", proxyPlugin.equals(plugin));
		assertTrue("4", plugin.equals(proxyPlugin));
	}
	
	private interface TestPlugin extends Plugin {
	}
	
// Path: brjs-core/src/main/java/org/bladerunnerjs/api/plugin/base/AbstractPlugin.java
// public abstract class AbstractPlugin implements Plugin {
// 	@Override
// 	public boolean equals(Object otherPlugin) {
// 		return (otherPlugin instanceof VirtualProxyPlugin) ? otherPlugin.equals(this) : (this == otherPlugin);
// 	}
// 	
// 	@Override
// 	public void close() {
// 		// do nothing -- concrete implementations may choose to override this method, but very few will ever need to
// 	}
// 	
// 	@Override
// 	public <P extends Plugin> boolean instanceOf(Class<P> pluginInterface) {
// 		return pluginInterface.isAssignableFrom(getClass());
// 	}
// 	
// 	@SuppressWarnings("unchecked")
// 	@Override
// 	public <P extends Plugin> P castTo(Class<P> pluginInterface) {
// 		return (P) this;
// 	}
// 	
// 	@Override
// 	public Class<?> getPluginClass() {
// 		return getClass();
// 	}
// 	
// }


// Path: brjs-core-tests/src/test/java/org/bladerunnerjs/plugin/VirtualProxyPluginTest.java
import static org.junit.Assert.*;
import org.bladerunnerjs.api.BRJS;
import org.bladerunnerjs.api.plugin.Plugin;
import org.bladerunnerjs.api.plugin.base.AbstractPlugin;
import org.bladerunnerjs.plugin.proxy.VirtualProxyPlugin;
import org.junit.Test;

package org.bladerunnerjs.plugin;



public class VirtualProxyPluginTest {
	@Test
	public void instanceOfWorks() {
		Plugin plugin = new VirtualProxyPlugin(new MyTestPlugin());
		
		assertTrue("1", plugin.instanceOf(MyTestPlugin.class));
		assertTrue("2", plugin.instanceOf(TestPlugin.class));
	}
	
	@Test
	public void equalityWorks() {
		Plugin plugin = new MyTestPlugin();
		Plugin proxyPlugin = new VirtualProxyPlugin(plugin);
		
		assertTrue("1", plugin.equals(plugin));
		assertTrue("2", proxyPlugin.equals(proxyPlugin));
		assertTrue("3", proxyPlugin.equals(plugin));
		assertTrue("4", plugin.equals(proxyPlugin));
	}
	
	private interface TestPlugin extends Plugin {
	}
	
	private class MyTestPlugin extends AbstractPlugin implements TestPlugin {