@Override
    public Comparison compare(final Path.Type type, final PathAttributes local, final PathAttributes remote) {
        if(Checksum.NONE == remote.getChecksum()) {
            log.warn(String.format("No remote checksum available for comparison %s", remote));
            return Comparison.unknown;
        }
        if(Checksum.NONE == local.getChecksum()) {
            log.warn(String.format("No local checksum available for comparison %s", local));
            return Comparison.unknown;
        }
        if(remote.getChecksum().equals(local.getChecksum())) {
            if(log.isDebugEnabled()) {
                log.debug(String.format("Equal checksum %s", remote.getChecksum()));
            }
            return Comparison.equal;
        }
        if(log.isDebugEnabled()) {
            log.debug(String.format("Local checksum %s not equal remote %s", local.getChecksum(), remote.getChecksum()));
        }
        return Comparison.notequal;
    }
@Test
    public void testCompare() {
        ComparisonService s = new ChecksumComparisonService();
        assertEquals(Comparison.equal, s.compare(Path.Type.file, new PathAttributes() {
                    @Override
                    public Checksum getChecksum() {
                        return new Checksum(HashAlgorithm.md5, "a");
                    }
                }, new PathAttributes().withChecksum(new Checksum(HashAlgorithm.md5, "a"))
        ));

        assertEquals(Comparison.notequal, s.compare(Path.Type.file, new PathAttributes() {
            @Override
            public Checksum getChecksum() {
                return new Checksum(HashAlgorithm.md5, "b");
            }
        }, new PathAttributes().withChecksum(new Checksum(HashAlgorithm.md5, "a"))));
    }