public synchronized void deletePartitionSchema( PartitionSchema removed ) {
    synchronizeTransformations( true, transMeta -> transMeta.getPartitionSchemas().remove( removed ) );
  }
@Test
  public void synchronizePartitionSchemasDeleteFromRepository() throws Exception {
    try {
      spoon.rep = repository;
      when( spoon.getRepository() ).thenReturn( repository );

      final String objectId = "object-id";
      final String partitionName = "partsch";

      TransMeta trans1 = createTransMeta();
      trans1.setRepository( repository );
      trans1.setSharedObjects( createSharedObjects( SHARED_OBJECTS_FILE ) );
      PartitionSchema part1 = createPartitionSchema( partitionName, false );
      part1.setObjectId( new StringObjectId( objectId ) );
      trans1.addOrReplacePartitionSchema( part1 );
      spoon.delegates.trans.addTransformation( trans1 );

      TransMeta trans2 = createTransMeta();
      trans2.setRepository( repository );
      trans2.setSharedObjects( createSharedObjects( SHARED_OBJECTS_FILE ) );
      PartitionSchema part2 = createPartitionSchema( partitionName, false );
      part2.setObjectId( new StringObjectId( objectId ) );
      trans2.addOrReplacePartitionSchema( part2 );
      spoon.delegates.trans.addTransformation( trans2 );

      assertFalse( trans1.getPartitionSchemas().isEmpty() );
      spoon.delegates.partitions.delPartitionSchema( trans2, part2 );
      verify( repository ).deletePartitionSchema( part2.getObjectId() );
      assertTrue( trans1.getPartitionSchemas().isEmpty() );
    } finally {
      spoon.rep = null;
      when( spoon.getRepository() ).thenReturn( null );
    }
  }