Skip to content

Instantly share code, notes, and snippets.

public class CastUsage2 {
public void useClass(SomeInterface input) {
((BaseClass)input).baseClassMethod();
input.someInterfaceMethod();
}
}
public class CastUsage {
public void useClass(BaseClass input) {
input.baseClassMethod();
((SomeInterface)input).someInterfaceMethod();
}
}
public class BaseClass {
public void baseClassMethod() {
/* Some implementation */
}
}
public interface SomeInterface {
public void someInterfaceMethod();
}
public class GenericUsage {
public <T extends BaseClass & SomeInterface> void useClass(T input) {
input.baseClassMethod();
input.someInterfaceMethod();
}
}
package com.khroliz;
import net.yandex.speller.services.spellservice.*;
import java.util.List;
public class WebServiceUsage {
public static void main(String[] args) {
SpellService service = new SpellService();
SpellServiceSoap port = service.getSpellServiceSoap();
assertTrue(someBooleanValue, "Some boolean value is not true as expected");
assertTrue(!someBooleanValue, "Some boolean value is not false as expected");
assertTrue(someObject != null, "Some object is null as not expected");
assertTrue(actualStringValue.equals("Expected String Value"), "Some string is not as expected");
assertTrue(someBooleanValue, "Some boolean value is not true as expected");
assertFalse(someBooleanValue, "Some boolean value is not false as expected");
assertNotNull(someObject, "Some object is null as not expected");
assertEquals(actualStringValue, "Expected String Value", "Some string is not as expected");
@Khrol
Khrol / query.sql
Last active December 24, 2015 22:19
select order_id from orders where funny_order = 1;
select * from (
select order_id from orders where funny_order = 1
order by dbms_random.value
) where rownum = 1;