public String getLastElementOfPath(String path) {

        return Paths.get(path).getFileName().toString();
    }
@Test
    public void testGetLastElementOfPath() {

        Path path = Paths.get(temporaryDirectory.getPath(), FOOBAR);

        String result = fileUtil.getLastElementOfPath(path.toString());

        assertEquals(FOOBAR, result);
    }