- 博客(8)
- 收藏
- 关注
原创 UML 类图
继承: 实线 + 空心三角 实现: 虚线 + 空心三角 依赖: 虚线 + 箭头关联: 实线 + 箭头聚合: 箭头 + 空心菱形合成: 箭头 + 实心菱形
2015-03-04 15:56:47
177
原创 Java shut down hook
Runtime.getRuntime().addShutdownHook(Thread);Before JVM shut down, it will call each hook you added.
2014-12-15 11:02:47
130
原创 Java generic methond without any parameters
Regarding following class: We define a generic class, but we donot have a method to resolve the generic.public final class Event<T> { private T event; private Event() {}...
2014-12-15 10:34:25
117
原创 Difference between matches() and find() in Java Regex Matcher
I am trying to understand the difference between matches() and find(). matches() tries to match the expression against the entire string and implicitly add a ^ at the start and $ at the end of y...
2014-12-11 14:21:44
136
原创 Mocking and Stubbing
Mockingcount abstract method invocations Stubbingget return of abstract method //mocking1 * subscriber.receive()//stubbingsubscriber.recerive() >> content//combine moc...
2014-12-10 17:05:07
203
原创 Spock mock generic type interface
public interface EventProducer<T> { public void send(T object);}declaration:def producer = Mock(EventProducer)usage:producer as EventProducer<String>
2014-12-10 16:34:14
197
原创 Spock Mock Cheatsheet
Spock Mock CheatsheetCraig AtkinsonExecutable examples at github.com/craigatk/spockmockcheatsheet Creating mocksUserService userService = Mock()def userService = Mock(UserService) Ar...
2014-12-10 16:29:38
143
原创 ScheduledExecutorService scheduleWithFixedDelay and scheduleAtFixedRate
ScheduledExecutorService has 2 method to schedule a taskschedule with fixed delayschedule at fixed rateI was confused about delay and rate, they both require a time parameter. What's the dif...
2014-12-03 23:35:48
180
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人