### Question:
EntryNodeWriter { protected Node getOrCreateByPath( final Node baseNode, final String path, final String intermediateNodeType, final String nodeType) throws RepositoryException { return JcrUtils.getOrCreateByPath(baseNode, path, false, intermediateNodeType, nodeType, false); } EntryNodeWriter(Session session, Node entryNode, CacheKey cacheKey, CacheContent cacheContent, long expireTimeInMilliSeconds, Clock clock); void write();  }### Answer:
@Test public void testGetOrCreateByPath() throws RepositoryException { final EntryNodeWriter writer = new EntryNodeWriter(null, null, null, null, 0, clock); final String path = "/some/path"; final Node baseNode = mock(Node.class); when(baseNode.hasNode(path)).thenReturn(true); final Node childNode = mock(Node.class); when(baseNode.getNode(path)).thenReturn(childNode); assertEquals(childNode, writer.getOrCreateByPath(baseNode, path, null, null)); }