- anonymous type can be replaced with lambda
- anonymous type can be replaced with method reference
- statement lambda can be replaced with expression lambda
Change-Id: Ie852df32bf6590e322655e8c983672914a139028
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
}
public static void main(String[] args) {
- ProxyHandlerFactory proxyHandlerFactory = new ProxyHandlerFactory() {
- @Override
- public ChannelHandler create(EventLoopGroup bossGroup, LocalAddress localAddress) {
- return new ProxyServerHandler(bossGroup, localAddress);
- }
- };
+ ProxyHandlerFactory proxyHandlerFactory = ProxyServerHandler::new;
start(proxyHandlerFactory);
}
}
private DOMMountPoint awaitMountPoint(final DOMMountPointService mountPointService) {
- await().atMost(5, TimeUnit.SECONDS).until(() -> {
- return mountPointService.getMountPoint(yangNodeInstanceId).isPresent();
- });
+ await().atMost(5, TimeUnit.SECONDS).until(() ->
+ mountPointService.getMountPoint(yangNodeInstanceId).isPresent());
return mountPointService.getMountPoint(yangNodeInstanceId).get();
}
@SuppressWarnings("checkstyle:IllegalCatch")
@Test
public void testCloseAllFail() throws Exception {
- final AutoCloseable failingCloseable = new AutoCloseable() {
- @Override
- public void close() throws Exception {
- throw new RuntimeException("testing failing close");
- }
+ final AutoCloseable failingCloseable = () -> {
+ throw new RuntimeException("testing failing close");
};
try {