@Test
public void entity() {

  ContextURL contextURL = ContextURLParser.parse(URI.create("http://host/service/$metadata#Customers/$entity"));
  assertEquals("Customers", contextURL.getEntitySetOrSingletonOrType());
  assertNull(contextURL.getDerivedEntity());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertTrue(contextURL.isEntity());
  contextURL = ContextURLParser.parse(URI.create("http://host/service/$metadata#Orders(4711)/Items/$entity"));
  assertEquals("Orders/Items", contextURL.getEntitySetOrSingletonOrType());
  assertNull(contextURL.getDerivedEntity());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertTrue(contextURL.isEntity());
  contextURL = ContextURLParser.parse(
      URI.create("http://host/service/$metadata#Users('user')/Messages('message')/Attachments/$entity"));
  assertEquals("Users/Messages/Attachments", contextURL.getEntitySetOrSingletonOrType());
  assertNull(contextURL.getDerivedEntity());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertTrue(contextURL.isEntity());
  // v3
  contextURL = ContextURLParser.parse(URI.create("http://host/service/$metadata#Products/@Element"));
  assertEquals("Products", contextURL.getEntitySetOrSingletonOrType());
  assertNull(contextURL.getDerivedEntity());
  assertNull(contextURL.getSelectList());
  assertNull(contextURL.getNavOrPropertyPath());
  assertTrue(contextURL.isEntity());
}