• Java 8 Lambda Expression

    Introduction: Lambda is a magic expression in Java 8, which makes tens or hundreds of lines become one line, and makes code concise and easy. This post will introduce using lambda expression for thread pool and stream. Thread pool lambda expression Recently I am using Java thread pool, and Mateusz...

  • Mockito Junit Test

    Intoduction: Mockito is very useful for Junit test. This post will discuss how to use mockito to write a Junit. Here I will discuss the difference between Stub, Mock and Spy. And use mockito to give three example. Stub, Mock and Spy These three concept shares some points, and also...

  • Guice Dependency Injection

    Dependency Injection: The behavior of Dependency Injection is like leave the bag to others. Not initialize the object each time we use it. We initialize it once and inject the dependency (pass as reference) each time. Still confused? Let’s split it into an example. Say we have a TicketService class...

  • AWS Elastic BeanStalk and RDS Quick Setup

    Introduction: Setup an AWS environment for testing and production environment can save a lot time compared with local environment setup. Also, a cloud environment helps developers cooperate more conveniently in web application development and deployment. This post shows how to setup Elastic BeanStalk and Rational Database system for serving a...

  • Jerseys environment easy setup using Maven

    Introduction: Previously I set up the jerseys environment step by step, it’s very frustrating because we need download many packages, build paths, package version… Today I found a very easy way to set up the Jerseys-1 development environment using Maven. Also, you can refer this post for setting up environment...

  • Build Restful server with Jerseys framework

    Introduction: Recently I am developing an Android application, which needs to write a server. I choose to build a restful server, because it’s most compatiable. We don’t need to build another server if we want to extend IOS, PC, Windows Phone or any other clients. I used tomcat as the...

  • JAX-RS Jerseys Eclipse Environment Setup

    Eclipse web application extensions Install the dynamic web application extensions and Server Adapters Help -> Install New Software Type in the current edition of eclipse, e.g. neon, then it will auto-completition, choose http://download.eclipse.org/releases/neon Select the following JST Server Adapters JST Server Adapters Extentions Eclipse Java EE Developer Tools Eclipse Java...

  • Andoird Screen Rotation

    Introduction Basically (If we do not add any code), if we rotate the screen, the previous activity will be automatically destroyed and the system will adjust the screen automatically. Of course, we want do more. Then we have this blog. It will introduce you how to build another layout for...