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.io.IOException; | |
import org.junit.Assert; | |
public class CheckedToUncheckedTest | |
{ | |
private static final String MESSAGE = "Ooops!!!"; | |
@org.junit.Test | |
public void test() |
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 org.apache.kafka.clients.consumer.ConsumerConfig; | |
import org.apache.kafka.clients.consumer.ConsumerRecord; | |
import org.apache.kafka.clients.consumer.KafkaConsumer; | |
import org.apache.kafka.clients.producer.KafkaProducer; | |
import org.apache.kafka.clients.producer.ProducerConfig; | |
import org.apache.kafka.clients.producer.ProducerRecord; | |
import org.apache.kafka.common.TopicPartition; | |
import org.apache.kafka.common.serialization.LongDeserializer; | |
import org.apache.kafka.common.serialization.LongSerializer; |
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
public static final String MESSAGE_DELIMITER = System.lineSeparator() + "-> "; | |
public static RuntimeException wrapToRuntimeException(Throwable t) { | |
return wrapTo(RuntimeException.class, t); | |
} | |
public static <C extends Class<? extends RuntimeException>> RuntimeException wrapTo(C clazz, Throwable t) { | |
return wrapTo(clazz, t, Main::chainCauseMessages); | |
} |
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.lang.management.ManagementFactory; | |
import java.lang.management.ThreadInfo; | |
/** | |
* @author Pavel Rogulin, created at 31.01.13 0:25 MSK | |
*/ | |
public class CycledClassInitialization | |
{ | |
static class ClassA { | |
static { |