Package helloworld.structural.flyweight

Source Code of helloworld.structural.flyweight.HelloWorldFlyWeightTest

package helloworld.structural.flyweight;

import helloworld.HelloWorld;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
/**
* @author yihua.huang@dianping.com
*/
public class HelloWorldFlyWeightTest {

    @Test
    public void testHelloWorldFlyWeight(){
        HelloWorld helloWorld = HelloWorldFlyWeightFactory.instance().createHelloWorld("Hello Flyweight!");
        assertThat(helloWorld.helloWorld(),is("Hello Flyweight!"));
        helloWorld = HelloWorldFlyWeightFactory.instance().createHelloWorld("Hello Flyweight!");
        assertThat(helloWorld.helloWorld(),is("Hello Flyweight!"));
    }
}
TOP

Related Classes of helloworld.structural.flyweight.HelloWorldFlyWeightTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.