GraphPartitioner { public GroupPartitioner getGroupPartitionerForReversedEdges(final String group) { if (!reversedEdgesGroupToPartitioner.containsKey(group)) { throw new IllegalArgumentException("No GroupPartitioner for key " + group + " exists for reversedEdgesGroupToPartitioner"); } return reversedEdgesGroupToPartitioner.get(group); } GraphPartitioner(); void addGroupPartitioner(final String group, final GroupPartitioner groupPartitioner); void addGroupPartitionerForReversedEdges(final String group, final GroupPartitioner groupPartitioner); GroupPartitioner getGroupPartitioner(final String group); GroupPartitioner getGroupPartitionerForReversedEdges(final String group); Set<String> getGroups(); Set<String> getGroupsForReversedEdges(); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode();  }
@Test public void testReturnsUsefulExceptionIfAskForPartitionerForNonExistentGroupForReversedEdges() { final GraphPartitioner graphPartitioner = new GraphPartitioner(); try { final GroupPartitioner partitioner = graphPartitioner.getGroupPartitionerForReversedEdges("NOT_THERE"); } catch (final IllegalArgumentException e) { return; } fail("IllegalArgumentException should have been thrown"); }