when(builder.properties(any(Map.class))).thenReturn(builder);
Job job = mock(Job.class);
when(job.getId()).thenReturn("id-123");
when(builder.add()).thenReturn(job);
String topic = JobHandlingReplicationQueue.REPLICATION_QUEUE_TOPIC + "/aname";
when(jobManager.createJob(topic)).thenReturn(builder);
when(jobManager.findJobs(JobManager.QueryType.ALL, topic, -1)).thenReturn(Collections.<Job>emptySet());
when(builder.properties(any(Map.class))).thenReturn(builder);
ReplicationQueue queue = new JobHandlingReplicationQueue("aname", topic, jobManager);
ReplicationQueueItem pkg = mock(ReplicationQueueItem.class);
assertTrue(queue.add(pkg));