@Test
public void testAddService() {

	final Set<String> addedServices = new HashSet<>();
	NgTemplate template = new NgTemplate("--", "NgTemplateTest") {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		protected void addFunction(String functionName,
				JavaScriptFunction function) {
			addedServices.add(functionName);
		}
	};
	template.addService("testService", new Object() {
		@ServiceMethod
		public void test1() {
		}
		@ServiceMethod
		public void test2() {
		}
		@SuppressWarnings("unused")
		public void test3() {
		}
		@SuppressWarnings("unused")
		private void test4() {
		}
	});
	assertEquals(2, addedServices.size());
	assertTrue(addedServices.contains("testService_test1"));
	assertTrue(addedServices.contains("testService_test2"));
	assertFalse(addedServices.contains("testService_test3"));
	assertFalse(addedServices.contains("testService_test4"));
}